Quantcast
Channel: Answers by "Kleptomaniac"
Viewing all articles
Browse latest Browse all 90

Answer by Kleptomaniac

$
0
0
Hey, Having read your last comment, I believe I understand what you want now. Try using [Quaternion.Lerp][1]: float maxRot = 45.0f; //Max neg and pos strafe rotation value float rate = 2.0f; //Rate of change for Lerp mainCam.transform.rotation = Quaternion.Lerp(mainCam.transform.rotation, Quaternion.Euler(axis * maxRot, mainCam.transform.rotation.y, mainCam.transform.rotation.z), Time.deltaTime * rate); Hopefully that should work. Haven't tested though. :) Klep [1]: http://docs.unity3d.com/Documentation/ScriptReference/Quaternion.Lerp.html

Viewing all articles
Browse latest Browse all 90

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>