- Home /
fps MouseLook with animation applied to camera.
As the title suggests, I'm making an fps style game. I have a bog standard, as supplied by Unity capsule, with the usual MouseLook, CharacterMotor and FPSInput. I've parented a gun to the camera, so far everything works. What I want to happen is, when the right mouse is clicked, 20 degrees of roll is put in the camera, and when released, the camera returns. I'm using animations, and with the MouseLook disabled it works perfectly. The left/right rotation still works, but looking up and down is disabled due to the script being turned off. If I enable MouseLook, the roll animaions play, then the camera immediately reverts to horizontal. It doesn't help that the MouseLook script is in C#, and I've learnt JS. D'oh! Can anybody point me in the right direction of how to apply the animations to the camera, and still have the MouseLook work please? I can upload vids to youtube if I've not made myself clear. I don't expect anyone to write code for me, but any ideas would be great.
Cheers
Ian
Answer by husbandofemily · Nov 02, 2012 at 06:39 PM
I got there in the end! If anybody needs this in the future, I inserted an empty gameObject in the heirachy, between the Player and Camera objects, then just added the animation to that. Sweet! Regards Ian
Thank you for providing your solution. It's very hard to find a topic asking about this.
Your answer
Follow this Question
Related Questions
Mouselook 90° Z-angle 3 Answers
Mesh Rotation Problems 2 Answers
Wait() is not working for me! 2 Answers
roller ball asset unity 5.0 1 Answer