- Home /
Delay child objects rotation
So clearly a child object will match the parents rotation, but I was wondering if there was a way to delay the child's movement? Like if the parent rotates to the right the child will rotate slower and then catch up. I'm pretty sure this would be an easier and more fluid way to create a weapon sway effect if I can get it to work.
I'm not an expert but i don't think that's as easy as you think it will as the child.position und rotation will always be relative to the parent's position/rotation. To do such a delay you would have to do so much scripting that in the end you would have made just a normal Gun Sway Script.
There are games you can play. For example, you can make an empty game object the child and then have your physical object track that child using a Lerp(), Slerp() or $$anonymous$$oveTowards() depending on the nature of the motion and the desired look of the movement. This is how some camera follow scripts work...especially ones that smooth out motion. You are likely to also have to do a Lerp() on the empty games objects rotation to keep the rotation of the physical game object and the empty game object aligned. Note this following will not necessarily cause the physical game object to follow the same path as the empty game object.
Your answer
Follow this Question
Related Questions
Make a simple tree 1 Answer
Is there a way to make a selected object a child of another object during the game? 1 Answer
Child versus Parent rotations 3 Answers
force child rotation to zero? 2 Answers
Ignore parent Rotation 1 Answer