- Home /
Problem with child and parent.
Hi, so I have a gun that is parented to the player, but when the player crouches(it changes his scale) the gun does too. Is there a way to prevent certain properties from being modified when they have a parent?
edit, the gun is parented to the camera that is parented to the player*
Answer by gribbly · Mar 10, 2013 at 10:15 PM
I think transform properties (position, rotation, and scale) are always transmitted to child objects.
You could do various things in script - e.g., attach a script to the gun that sets an absolute scale every frame.
BTW scaling your player sounds like a strange way to handle crouch... of course I know nothing about your game. But are you sure you shouldn't be scaling a collider as opposed to the entire player transform?
Scaling the collider is actually a good idea, I am going to try that then get back. Also as for the script, If you are talking about setting the localScale to the same thing every frame, it didn't work.