system
March 17, 2023, 2:37pm
1
Attention
Topic was automatically imported from the old Question2Answer platform.
Asked By
AcoAlex
I am moving an Area2D based on its rotation with this code:
global_position += transform.x * delta * speed
But how can I prevent my AnimatedSprite2D node from rotating with its parent node?
system
March 17, 2023, 4:03pm
2
Reply From:
spaceyjase
Use a RemoteTransform2D
node to apply the parent transform to the desired node with just the selected update: RemoteTransform2D — Godot Engine (stable) documentation in English
An alternative would be to ‘fix’ the rotation in the child node; e.g. to maintain an angle of zero (0) in _process
.
system
March 17, 2023, 4:50pm
3
Reply From:
zhyrin
CanvasItem
has a member called top_level
. Setting this to true
will prevent it from receiving any transform from its parent. With a script or a RemoteTransform2D
node, you can apply the position only.