Lean left & Lean right help

So, I’m pretty new to C# and Unity as a whole. I have a great idea for this game I’m creating but I want to make my character lean left and lean right whenever you press q and e so q would be for leaning left and e would be for leaning right. Whenever you release either of the buttons, you’ll return back to the normal view. (which im using the standard FPS camera). I put the script as lean : Monobehaviour etc etc. Help would be really appreciated. Thank you in advance :smile: also, if its not too much to explain how it works that’d be cool, but if it is too much I’ll try to figure it out myself. Again, thank you!

Since it is an FPS camera, you don’t have to show the player himself leaning, I presume.

The first try I would do on this would be to put an extra GameOobject above your Camera’s transform, and then use the Camera’s localRotation below that to lean however much you want, when those keys are pressed.

This will of course not have any impact on the player’s actual position in world, as represented by the parts higher-up. Think of this approach as adding an extra “leaning hinge” that you can control.

hmm, I’ve been trying that out but idk how to add a game object over my characters transform. I’m also fairly new… i tried to add component but I cant seem to put a game Object over it.