#1 FPS Movement: Let's Make a First Person Game in Unity!
Why Stack Overflow recommends it
Stack Overflow users cite it as the tutorial they were following when their movement, jump, or look code throws errors or behaves wrongly.
Recommended by 2 people across 2 different months, 2022 to 2024.
What it is
A 21-minute Unity tutorial by Natty GameDev, the first in a series on building a first person game. It sets up the player with the new Input System, then covers movement, gravity, jumping and mouse look, with timestamps for each code section.
What people said
Recommends Gobster07 · 2023-04 · Stack Overflow · on “My character is jumping mid air in unity and i cant figure out what im doing wrong”
im making a game in unity based in this tutorial [this video] but my character keeps jumping mid air heres my code; using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMotor : MonoBehaviour { private CharacterController controller; private Vector3 playerVelocity; private bool isGrounded; public float speed = 5f; public float gravity = -9.8f; public float jumpHeight = 3f; // Start is called before the first frame update void Start() { controller = GetComponent<CharacterController>(); } // Update is called once per frame void Update() { isGrounded = controller.isGrounded; } //Receber os inputs e aplicar no controle public void ProcessMove(Vector2 input)
Recommends оказывается · 2024-01 · Stack Overflow · on “Mouse is inverted in Unity when I click play”
So, I followed a tutorial on youtube to learn how to look around: [this video] (16:55 is the start of looking) and when I go in, down is up, and vice versa. My code is below: (INPUT MANAGER) using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; public class InputManager : MonoBehaviour { private PlayerInput playerInput; private PlayerInput.OnFootActions onFoot; private PlayerMotor motor; private PlayerLook look; // Start is called before the first frame update void Awake() { playerInput = new PlayerInput(); onFoot = playerInput.OnFoot; motor = GetComponent<PlayerMotor>(); look = GetComponent<PlayerLook>(); onFoot.Jump.performed += ctx => mot
Cites Kate Z · 2022-11 · Stack Overflow · on “How do I fix "does not contain a definition for" and "no accessible extension method" in unity after saving a C# script?”
I was following this video on YouTube for creating a fps game, [this video] , I got to the 9 min mark. When I saved my C# script and went on back to Unity there was two error messages and I don't know what they mean nor how fix them. This is the first one: Assets\Scripts\InputManager.cs(23,16): error CS1061: 'PlayerInput.OnFootActions' does not contain a definition for 'enable' and no accessible extension method 'enable' accepting a first argument of type 'PlayerInput.OnFootActions' could be found (are you missing a using directive or an assembly reference?) This is the second one: Assets\Scripts\InputManager.cs(27,16): error CS1061: 'PlayerInput.OnFootActions' does not contain a definition for '
Cites fox100 · 2023-07 · Stack Overflow · on “i dont know what this means: error cs0426”
I saw this tutorial for making 1 person game: [this video] And I get this error: Error CS0426: The type name 'OnFootActions' does not exist in the type 'PlayerInput' This is my code: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.InputSystem; public class InputManger : MonoBehaviour { private PlayerInput playerInput; private PlayerInput.OnFootActions onFoot; private PlayerMotor motor; // Start is called before the first frame update void Awake() { PlayerInput = new PlayerInput(); onFoot = PlayerInput.OnFoot; motor = GetComponent<PlayerMotor>(); } // Update is called once per frame void FixedUpdate() { // tell the playermotor to move using the valu