Is there a way to change the default transform of a node?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By BriKun
  1. Is it possible to rotate a shape2D 20 degrees, and have that be the new 0 rotation for the node?

  2. Is it possible to change the center position of a node?
    Can I make a 10x10 square and have the “center” be (5,3)?

Thank you.

:bust_in_silhouette: Reply From: Zylann

Is it possible to rotate a shape2D 20 degrees, and have that be the new 0 rotation for the node?

Every Node2D gets an identity transform by default when created (position zero, scale one, and no rotation). There is no way to change this initial value (but you can change it once created). You could create a scene containing your node, and choose the initial values from here. This scene can act like a “prefab”. Next, when you want to create an instance of it, load that scene and instance it, and it will start with the values you configured.

Is it possible to change the center position of a node?
Can I make a 10x10 square and have the “center” be (5,3)?

Which node? It depends what type you are talking about. If it’s a Sprite, you can choose where its pivot is by adjusting properties below the Offset category in the inspector. You can also put your node as child of another so the parent will act as pivot.