Fix: The reason I wanted to unparent the bat was to stop it from moving with the player, but for some reason that I still don’t understand the bats position got locked when I unparented it so I couldn’t move it, so I settled and made it so the player can’t move when I don’t want the bat to move. Yeah, it’s lazy but hey, it works.
Not much to say here, the title pretty much sums up the whole question.
Here’s what I’ve tried
It depends. Are you trying to preserve the object’s position in the world? Or are you trying to preserve the object’s position relative to its parent? ```csharp
*// This will preserve the bat’s local position
bat.transform.SetParent(null, false):
// This will preserve the bat’s world position
bat.transform.SetParent(null, true);
// which is also equivalent to
bat.transform.parent = null;* ```