Free Look Camera Rig Changing Rotation
Okay, So I'm making a 3d game and I use the Free Look Camera Rig provided with Unity. What I want to do is the following: If a certain animation plays, I want the Camera to basically get locked and rotate in a certain direction, lets say downwards for example. The Reason for this is, that my character is moving relatively to the camera and I want him to be forced downwards for a little (dont have gravity there) without being able to get back up. while that animation plays.
I know how to check if the animation plays and I also can change the cameras rotation, but it only works very wierdly (delayed and other wierd stuff). Is there a simple solution on how to make the Freelook Cam rig basically orbit upwards around my character for the duration of the animation?
I'm not familiar with the FreeLookCemeraRig, but I do know you can make any animation trigger a function call. You can configure this called function to start an animation on your camera rig (or even start a co-routine to move it yourself). http://docs.unity3d.com/$$anonymous$$anual/animeditor-AnimationEvents.html
You mentioned it works wierdly, how are you doing it now?
Answer by Semml · Oct 02, 2015 at 06:58 PM
I ended up making a second freelookcamrig (that doesnt actually work as a camera but just for math and moving relatively and stuff and changed the rotation on it with this:
mathCam.rotation = Quaternion.Slerp (Quaternion.Euler( 35f, mathCam.parent.transform.eulerAngles.y, mathCam.parent.transform.eulerAngles.z), Quaternion.Euler( mathCam.parent.transform.eulerAngles.x, mathCam.parent.transform.eulerAngles.y, mathCam.parent.transform.eulerAngles.z), 0.1f * Time.deltaTime);
I made the second cam so the camera wouldnt actually change and just the character movement will.