-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera2D moves later than it's parent and its siblings when lerping or tweening its parent #77813
Comments
I tried the workarround sugested in related issues, calling force_update_scroll(). It fixes the problem using lerp, but it doesn't fix the problem using tweens. |
That's probably because tweens fire at the end of the frame, try using a method tweener that combines the update with sending this signal |
Can you explain how could I do that? I'm a begginer and I don't know what do you mean by combining the update. |
See here and do the position update and the |
Thank you, it worked. |
Thanks for the report! Consolidating with #74203. |
Godot version
4.0.3 stable
System information
Win 10, rx580 AMD GPU, Intel i5 CPU.
Issue description
When I lerp or tween the position of the parent node of a Camera2D, the Camera2D will start and stop moving slightly but noticeably later than its parent and its siblings. This behaviour is the same with compatibility mode or forward+ mode, and it's the same on the Godot 4.1 dev 4 version. This doesn't happen in Godot 3.5.3.
Steps to reproduce
Add a sprite to have a background. Then a node2D to have a parent. Add a camera2D and a sprite as childs of the node2D. Move the Node2D using lerp or tweens. As the camera and its sibling are being moved at the same time by the parent, you shouldn't see the sibling sprite moving at all, only the background, but because the camera will move slightly later than its sibling sprite, the sprite will move a little bit at the beggining and end of the movement.
Minimal reproduction project
Using the actions:
"ui_up" will lerp the parent node up. Camera2D moves later than its sibling and its parent.
"ui_down" will tween the parent node down. Camera2D moves later than its sibling and its parent.
"ui_right" will just change the parent node position. Camera 2D moves at the same time as its sibling and its parent.
tween parent movement lag.zip
The text was updated successfully, but these errors were encountered: