3D How can I make a child(spear) independent from its parent?

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

Basically what i have is a Kinematic body player, carrying a spear(rigid body) as a child.
I can’t get the throwing part quite right.

I assume I have to make the spear be independent from the player on “throw_spear” input then apply impulse.
I have no clue how to do this, i can do the impulse part.
I did however manage to create a spear copy and yeet that from position, but it’s not the actual spear.

Help please

:bust_in_silhouette: Reply From: Inces

You can unchild the spear before yeeting it. Just make your player call remove_child() with reference of spear. However this will cut any other ties spear had with the player, and depending on how You coded it, may provoke bugs and errors.
If You want to avoid it, You can optionally only make position/transform independent, by making spear call set_as_top_level() before yeeting it.
Finally, there is also a node RemoteTransform, that lets You choose what part of transform ( rotation or position ) can be independent and which can’t.