How to locally rotate a kinematic body but not its children?

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

I have some code set up to rotate my player node but the camera and all its other children nodes rotate as well. How do I just rotate the player and not its children?

:bust_in_silhouette: Reply From: magicalogic

Set the other objects as top level. That way transformations to them only happen in global wpace.
This can be done in the inspector or via code.
In the scripts of children add:

_ready():
    set_as_toplevel(true)