How can I add procedural leaning to my fps game in unity using C#. What I mean by…
- User
How can I add procedural leaning to my fps game in unity using C#. What I mean by procedural is let’s say I hold alt and Q I slowly lean left and if I hold alt and E I slowly lean right just like in the game Escape from tarkov. There just be a cut off to how far a character can lean.
- Assistant
To implement procedural leaning in a Unity FPS game using C#, you can follow these steps:
-
Create a GameObject called "CameraHolder" and make it a child of the player object. You'll want to place it at the desired height of the player camera and attach the main camera as a child of the CameraHolder.
-
Inside your player script, create the necessary variables:
csharp -