-
Notifications
You must be signed in to change notification settings - Fork 0
Quick Wiki (READ)
To be able to use the character controller you will need:
- A Unity capsule as player with a Character Controller component attached to it.
- A Camera attached to the Player as a child.
- Set the Player (and it's children) to its own layer and have the Camera ignore that layer.
- Enable Unity's old input method.
- Attach the 'PlayerMovement' C# file to the Player.
- Attach the 'CameraMovement' and 'Bobbing' C# files to the Camera.
- Click "Play" and test everything out, then adjust the values according to your wishes (see how below).
Assign the values of walking/running speed according to desire and relative to the size of your map.
Use "Enable Running" to enable/disable the ability to run.
Use "Enable Jump" and "Enable Double Jump" to enable/disable the ability to jump and double jump, respectively.
Adjust the values for the "Jump force" and "Double Jump Force" to change the height of jumps and double jumps, respectively.
Adjust the value for "Gravity Force" to change the gravity force affecting the player after jumping or double jumping.
Use "Enable Dashing" to enable/disable the ability to dash.
Adjust the values of "Dash Speed" and "Dashing Distance" based on desire for how the dashing should feel. If you play around with these values you will get your desired effect of dash.
Dashing currently can only be done once. It is designed for you to be able to reset the ability either via time or pick-ups. The dashing ability is activated by "Q".
"Max Camera Tilt Angle" is the maximum angle at which the camera will turn (sway) when the player moves sideways.
"Camera Tilt Speed" is the speed at which the camera reaches that max tilt angle and also recovers from it after the player stops moving sideways.
"Camera Body Offset" is the cameras y-position as a child of the player. First manually adjust the camera on the player to an elevation you desire, then set "Camera Body Offset" as the cameras y-position.
"X/Y Bobbing Distance Multiplier" assign the size of the infinity-sign-path that the camera will move in (that generates the bobbing effect). See image below.
If you choose to have audio, you must assign audio for footsteps, jumping and dashing.
Use "Enable Sounds" to enable/disable sound effects (using different gameObjects with audioSources).
Variables "Footstep Volume Min/Max" and "Footstep Speed Min/Max" directly affect the footsteps' sound effects. You can add one footstep sound effect or many more (to make it sound more natural).
The variable "Footstep Delay" decides the time between each time a footstep sound effect is triggered. It is very frame-rate dependent and also depends on how long your footsteps' sound effects are (just mess around with the values and see what sounds best).