Description
This is a simple 3D movement system for Unity using mouse input for rotation and keyboard input for movement, jumping, and dashing.
Features
- Mouse-controlled rotation using the
Mouse X
andMouse Y
axes - Keyboard-controlled movement using the
Horizontal
andVertical
axes - Jumping with the
Space
key - Dashing with the
Left Shift
key - Adjusting player height with the
Left Control
key (for crouching)
Instructions
- Attach the
MouseRotation
script to the player's GameObject. - Attach the
Move
script to the player's GameObject. - Create a Collider and a Rigidbody components for the player's GameObject.
- Assign the Collider and the Rigidbody components in the
Move
script. - Create a GameObject with a tag of "Ground" to represent the ground surface.
Controls
- A and D keys:
Horizontal Axis
- W and S keys:
Vertical Axis
- Jump:
Space
key - Dash:
Left Shift
key - Crouch:
Left Control
key
Known Issues
- Dashing may cause the player to slide along the ground.
TODO
- Improve collision detection for dashing.
- Add more advanced movement mechanics, such as wall jumping and sliding.