[ad_1]
I’m making an attempt to arrange a sport with portals in it. I’ve been struggling for some time now to rotate the Player. I’ve tried Quat.Slerp, Quat.AngleAxis, and Quat.Euler. But by means of rigorous testing I found that the MouseLook operate in my FPS Controller script is the rationale the Player is not rotating. The participant is being rotated, however half a body later, the MouseLook script resets the Player’s rotation.
How can I rotate the participant with out letting the MouseLook operate of my FPS Controller script get in the way in which?
void MouseLook()
{ mouseX = Input.GetAxisRaw("Mouse X") * sensX * Time.deltaTime;
mouseY = Input.GetAxisRaw("Mouse Y") * sensY * Time.deltaTime;
yRot += mouseX; xRot -= mouseY;
xRot = Mathf.Clamp(xRot, -50f, 50f);
rework.rotation = Quaternion.Euler(xRot, yRot, 0);
}
[ad_2]