I am trying to make my player model rotate with the camera orbit script, but only on the Y axis.
So far I can have it rotate on every axis for the camera. This is what I’ve tried:
var Player : Transform;
var playerRotateSpeed = 2.0;
function Update () {
rot = transform.rotation; //rotation of the camera
Player.transform.rotation = Quaternion.Slerp(Player.transform.rotation, rot, playerRotateSpeed);
}
If I try (Player.transform.rotation.y, rot, playerRotateSpeed) it gives me an error saying slerp can only use (Quaternion, Quaternion, Float) and I’m giving it (Float, Quaternion, Float). Same if I try rot.y or anything else.
How can I get the rotation of one axis of my camera and Player in Quaternion form?
Using JS. This is probably really simple - I apologize as I only know C# and this mouse orbit script was in JS.