- Home /
Question by
Dorscherl · Apr 03, 2018 at 01:11 AM ·
rotationquaternionrotation axisquaternions
Prevent child rotation but still control it yourself
I have a child object on my player that I (the user) rotate to give the head a target (using it's forward). It works great UNTIL I start rotating the parent. Then it seems to take the parent object's rotation values and screws up the rotation I want to do. How do I make it so the parent's rotation doesn't affect the child's rotation while still allowing me to rotate it myself?
Comment
Best Answer
Answer by tormentoarmagedoom · Apr 03, 2018 at 07:28 AM
Good day.
I supose you need to "apply a negative rotation" to your child object with the value of player actual rotation.
I mean:
ChildRotation = new Quaternoin (LocalRotationYouwant - ParentRotation)
So, as Player moves, the child will have a worldrotation "independent" from player rotation.