Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | ravenblack | |
Old Version | Published before Godot 3 was released. |
I have a global “Man” object that I want to move between scenes. During the transition I do:
`get_tree().set_pause(true)
(play a pause-resistant transition animation)
(load the new scene)
Man.set_global_pos(position of entrance marker node in new scene)
(play a pause-resistant return-transition animation)
get_tree().set_pause(false)`
After this unpause, for one frame Man acts like he’s still in the pre-teleport position, triggering colliders and having unexpected ray-casts. I hacked around some of these side-effects by setting a “skip_frame_
” boolean in Man_, and if that’s true in _fixed_process
, set it to false and return immediately. This resolved the unwanted interactions in Man’s code, but unwanted colliders are still triggered by the outdated location. (And obviously I’d rather not have to inject this weird hack anyway.)
Is there some way to make the position of a KinematicBody2D fully update while the tree is paused?
This is with v2.1.3.stable.official