![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | siska |
The Godot 3.1 documentation tells us we should use call_deferred() for :
. disabling collisionshapes (Godot doc)
. switching scenes (Godot doc)
. (probably a bunch of other things)
… because :
. the collision engine might be busy processing things
. the scene code might still be doing stuff
. (???)
So : should we use call_deferred() everywhere instead of just calling the method ? What are the rules ???
Edit : maybe I should rephrase my question a bit … : When is NOT using call_deferred() going to cause problems in my exported game (for pc) ?
I know for disabled a collisionshape you do this:
set_deferred(“disabled”,true)
thoma | 2019-05-06 17:17
Thanks, Thoma !
Do you know more about when one should use ‘deferred’, and when one can just call the method itself ?
It is a bit confusing to me : if ‘deferred’ is ‘the safe way to do it’, then … why is this not always happening ‘behind the scenes’ ?
siska | 2019-05-06 17:48
No but this video can help you
Tutorial about deferred
thoma | 2019-05-06 18:29
Thanks ! I’ll take a look …
Seems like an interesting series to watch. Not quite the info I’m looking for, but definitely interesting !
siska | 2019-05-06 18:35
+1’d this - after upgrading to 3.1 I’ve had to use call_deferred in a lot of my collision logic, which has somewhat muddied my code, e.g. using call_deferred(‘magic-string’) in place of direct calls.
christh | 2019-05-15 15:43