Custom Rotation for Z-Axis on First Person Controller

Hi, I want to be able to rotate the z axis while using the first person controller in the asset store.
I basically want to make the player have that smooth game feel like in Evade or Nico’s Nextbots.
When I turn left or right, the z rotation changes and slowly comes back to 0.
When I move left or right, the same thing should happen.
I’ve tried using local euler rotation but it didn’t work.
It just was rotating the z axis in the forward vector of the entire scene, so if I am perpendicular to the forwad of the scene, it becomes as if it never roated on the z axis. If I am looking backwards of the scene, the rotation becomes reverse. :slight_smile:

project

Also, I want to try to use entities as a separate rotation. The camera will be a child of the x and y rotation axes while the z would be using local rotation on camera. I want to know if there is a better way before I mess up some code.

Bump!
Edit: I have tried using an entity for x and y rotations and camera for z rotations and it worked.
I just want to know if there is a better way or an alternative.

For future readers using the first person controller from the asset store:
Add new entity to player and make camera the child of the new entity. In first-person-view code, change this in post update

this.camera.setEulerAngles(this.elevation, this.azimuth, 0);

to

// this.xy === new entity for x y rotations
this.xy.setEulerAngles(this.elevation, this.azimuth, 0);
this.camera.setLocalEulerAngles(0, 0, this.zRot);

Hierarchy = Player > XY > Camera
:slight_smile: