How do I control player orientation via camera movements?

Hello, I am new to Unity and scripting in C# in general. I am aiming to make a first person shooter that utilises the player’s camera movement in order to build score and have the player do more damage to other enemies.

What I mean by this is that I want a similar system like in Clustertruck whereby the player is able to do flips in the air and rotate however they move their camera but have that rotation be trackable and also contribute to the gameplay outside of style. The intended gameplay is to have the more rotations done in mid-air to cause increment a counter that corresponds to how damaging the player’s attack will be.

I tried looking up solutions to this problem but I was unable to find any that worked and my own tweaking in my camera and movement script didn’t help.

I am also using the scripts from Dani’s Unity FPS movement tutorial on youtube:

Sounds complicated. You might need to break down and define the actual relationship between camera controls inputted by the user and what actually happens while you’re flipping.

Until you define what the target game actually does it will be very difficult to replicate it except by chance.

Generally rotations can be multiplied by each other to rotate one another in a cascade. Order of operation is critical, as in Rotation1 * Rotation2 is going to give different results than Rotation2 * Rotation1, so start slow and build up in layers with lots of debugging rigs created to isolate what is going on.

It may also be useful to parent a series of transforms together, with each transform only handling one axis of rotation at a time. It might also be necessary to NOT parent stuff and instead have certain transforms explicitly drive only the position (or only the rotation) of others, basically a custom gimbaling joint.

ALSO, as an aside, in general Camera stuff is pretty tricky hairy advanced stuff, especially when it comes to flying rotating objects and making it work the way you want… you may wish to consider using Cinemachine from the Unity Package Manager, if that is amenable to whatever your game design needs:.

There’s even a dedicated forum: https://forum.unity.com/forums/cinemachine.136/