how to make node dont rotate with its parent node ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ARSHAVIR_GM

in one of my enemy scenes i threre is something like this:

  • area2d
  • -collision polygon
  • -texture progress

i want to texture progress move with area2d but dont rotate with it

how i can do that?

:bust_in_silhouette: Reply From: skysphr

The pretty straight forward but not-so-elegant way is to set its rotation to -parent.rotation. You also have the option of setting it as toplevel and updating its position manually. However, the more principled way would probably be to structure the scene such that the graphical elements that need to be rotated are separated from the graphical elements that don’t:

- node2d
  - area2d (gets rotated)
    - collision poly
  - texture progress