You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an attempt to create a moving and rotating platform that syncs to physics, I created an AnimatableBody2D and updated the code to manipulate my object rather than use an animation.
You can combine rotation/position/scale into Transform2D in advance and then set transform.
Or use RemoteTransform2D, then modify the position/rotation/scale of the RemoteTransform2D.
ZeAntwan
changed the title
Updating rotation and position of AnimatableBody2D in code only updates using the last instruction
Updating rotation and position of AnimatableBody2D in code only updates using the last instruction when sync to physics is enabled
May 4, 2023
Godot version
4.0.2.stable, 4.1.dev1
System information
Windows 10
Issue description
In an attempt to create a moving and rotating platform that syncs to physics, I created an AnimatableBody2D and updated the code to manipulate my object rather than use an animation.
The code I'm using is this:
What I expect:
A clockwise rotating object that goes from left to right.
What I get:
Only the last instructions updates the object, in this case, the position.
Doing this on the parent class (StaticBody2D) OR disabling the sync to physics makes it work, but you lose the sync to physics.
I might be doing this wrong, but couldn't find info around it, so sorry if this is a non-issue.
Steps to reproduce
'''
func _physics_process(delta):
global_rotation_degrees += delta10
global_position.x += delta10
'''
Minimal reproduction project
N/A
The text was updated successfully, but these errors were encountered: