How to rotate 1st person object with mouse

How do I turn(rotate) my 1st person character move with mouse input?

Hi @Squid_Gamer780,

I would recommend you start by taking a look here:

https://developer.playcanvas.com/en/tutorials/first-person-movement/

This is the official tutorial for rotating a character in a first person script.

While that tutorial is efficient, it still relies on Euler angles, and it does not clamp those angles meaning you can end up upside down while moving the camera.

Below is a tutorial created for Unity using the more adaptive Quaternion approach. Of course the code is different from Playcanvas as it’s written in C#, but the principles should be the same. I will see if I can build a Playcanvas version in the morning, but I think just watching and getting an understanding of what Brackey’s is doing in his video in Unity will be helpful to you:

I hope this information is helpful to you.

2 Likes