i need my player to become parented to other objects sometimes, and im trying to do this in a state of the character controller in the physics process
this is what i have for the state:
if current_state == State.cockpit:
get_parent().remove_child(self)
get_node("/the_game/Spaceship").add_child(self)
when i try to activate the state, it says that the node i am trying to get is null. both the player and the part id like it to be parented to are only children of the root part
what am i doing wrong and is there a better way to do this