Hello! I’m new to Unity and game development in general. As of now, I’m trying to make a simple 3rd person shooter game. I’m starting off by creating a simple scene for testing, adding a player, giving it movements and adding a camera.
I find movement and camera very important which is why I refrain from using advanced prefab or over developed scripts, as they often come with additional functions that I don’t want or need.
Currently, I’m using these scripts for my player game object:
- Movement -
(Unity - Scripting API: CharacterController.Move)
- MouseLook -
(SimpleMouseRotator.cs accessible in
the standard assets->utility scripts)
So, here are my current issues:
Issue with movement script: pushing keys that would move the player in the opposite direction doesn’t cancel movement (eg. pushing and holding down W and then S doesn’t stop the player from moving forward). I would like the player to stop walking, and upon releasing W with S still held down, move backwards.
Also I would like it to be possible to move the player slightly while in the air. Sort of like air acceleration. What is a good way of doing so? Adding a rigidbody-component and adding force to a player whilst isGrounded = false?
With the current MouseLook-script, the player model rotates horizontally which is all good. When aiming higher or lower however, the player model starts flipping around like crazy. I would like the player model to remain in an upright position but for the camera (and hypothetical crosshair/target) to follow the mouse movements.
Any help is appreciated!