Skip to content

Disabling the CollisionShape2D in the editor drastically improves the loading time #11522

@Rinkton

Description

@Rinkton

Your Godot version:
Godot 4.5.1

Issue description:
I'm working on the project which loading many CharacterBody2D nodes which have enabled CollisionShape2D-s as the children in each one on the start of the game.

It was taking pretty long, but suddenly I've discovered for myself that if I will disable CollisionShape2D's in these CharacterBody2D-s in the editor and then will write in their _ready func

$CollisionShape2D.set_deferred("disabled", false)

then everything will work as before(at least in my situation), but the loading time will be improved drastically(e.g. in the game itself it will be loading 2s instead of 20s).

I think that it's an important thing to note somewhere in the documentation as it's not that obvious but makes the loading of the games where are many CharacterBody2D on the scene on the start much more efficient.

I pin MRP in order you can ensure it yourself.
cs2d_disabled_performance_boost.zip

P.S. For the StaticBody2D it wasn't that noticeable, so I guess it isn't actual for this.

URL to the documentation page (if already existing):
Not sure it either should be CharacterBody2D or CollisionShape2D

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions