- Home /
Question by
gametarian · May 29, 2018 at 02:42 PM ·
animationrotationscripting problembone
Rotate a bone with mouse input while animation is playing
I want to rotate my model's spine with mouse input along Y axis while an animation is being played. I have written the following lines inside LateUpdate()
LateUpdate()
{
float rotationSpine = Input.GetAxisRaw("Mouse Y") * senseY;
Vector3 spineMovement = new Vector3(0, 0, rotationSpine);
spine.transform.localEulerAngles += spineMovement;
}
But the model's spine gets reset back to the animated position after every frame giving it a jittery effect. I want my model's spine to hold the last value provided until there is another mouse input from me. Please Help or ask for further information on my problem.
Comment