How to quit movement in child nodes

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By IranosMorloy
:warning: Old Version Published before Godot 3 was released.

Hey all.

I have a problem. I’m a beginner programmer. I’ve created a node for player, wrote down the movement, then added another node for GUI. The problem is that the game is board game, player can rotate in any 2d direction and everything else is rotating too, even the GUI.

The question is: how to quit the players movement so the GUI, etc. that should not rotate, won’t rotate?

The code I used for rotating the player_ship is:

 if Input.is_action_pressed("btn_A"):
		set_rot(get_rot() + delta * rotation_speed)
 if Input.is_action_pressed("btn_D"):
		set_rot(get_rot() + delta * -rotation_speed)

Rotation speed is exported var. If I reparent the GUI from the player’s character to just node2d called player, the GUI is not moving at all. Any hints/advices?

Thank you in advance! :slight_smile:

:bust_in_silhouette: Reply From: eons

The GUI should be separated, I recommend you to search about signals and learn how to communicate between scenes with them to pass values and other useful things.

Another thing, the UI use to be made under another CanvasLayer (usually one just for UI elements) so you can manage it separated from other game entities (visually at least).

These 2 things will make a lot easier to organize elements in a board game, in particular.


And a way to “cheat” the system in cases that other options are not suitable for reasons, using a Node as parent will make the children ignore the (grand)parent transform because Node does not have transform.