Changing the rotation of a node without changing sprite rotation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: 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?

:bust_in_silhouette: 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.

:bust_in_silhouette: 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.