About 709,000 results
Open links in new tab
  1. To implement player movement in Unity 3D, you can use the CharacterController component or Rigidbody physics, depending on your game's requirements.

    Using CharacterController

    1. Setup: Attach a CharacterController component to your player GameObject. This component allows for easy movement and collision detection without using physics forces.
    2. Basic Movement Script: Here’s a simple script to get you started with player movement using the CharacterController:
    using UnityEngine;
    public class PlayerMovement : MonoBehaviour
    {
    private CharacterController controller;
    public float speed = 5.0f;
    public float jumpHeight = 1.5f;
    private Vector3 playerVelocity;
    private bool groundedPlayer;
    void Start()
    {
    controller = gameObject.AddComponent<CharacterController>();
    }
    void Update()
    {
    groundedPlayer = controller.isGrounded;
    if (groundedPlayer && playerVelocity.y < 0)
    {
    playerVelocity.y = 0f;
    }
    float moveX = Input.GetAxis("Horizontal");
    float moveZ = Input.GetAxis("Vertical");
    Vector3 move = new Vector3(moveX, 0, moveZ);
    controller.Move(move * speed * Time.deltaTime);
    if (Input.GetButtonDown("Jump") && groundedPlayer)
    {
    playerVelocity.y += Mathf.Sqrt(jumpHeight * -2f * Physics.gravity.y);
    }
    playerVelocity.y += Physics.gravity.y * Time.deltaTime;
    controller.Move(playerVelocity * Time.deltaTime);
    }
    }
    

    Using Rigidbody

    1. Setup: Attach a Rigidbody component to your player GameObject. This allows for physics-based movement.
    2. Basic Movement Script: Here’s a simple script for player movement using Rigidbody:
    using UnityEngine;
    public class PlayerMovementRigidbody : MonoBehaviour
    {
    private Rigidbody rb;
    public float moveSpeed = 5f;
    void Start()
    {
    rb = GetComponent<Rigidbody>();
    }
    void FixedUpdate()
    {
    float moveHorizontal = Input.GetAxis("Horizontal");
    float moveVertical = Input.GetAxis("Vertical");
    Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical) * moveSpeed;
    rb.MovePosition(transform.position + movement * Time.fixedDeltaTime);
    }
    }
    

    Additional Resources

    unity3d.com
    Unity - Scripting API: CharacterController.Move
    Supplies the movement of a GameObject with an attached CharacterController component. The CharacterController.Move motion moves the GameObject in the given direction. The given dir…
    Sharp Coder Blog
    Creating Player Movement in Unity - Sharp Coder Blog
    Learn how to create basic player movement in Unity using input handling and Rigidbody component. Follow the step-by-step guide with code examples and tips for enhancing the movemen…
    YouTube
    UNITY 3D PLAYER MOVEMENT in 2 MINUTES! FPS Shooter
    Walk, Run, Jump and Sprint! Easily customizable! A very simple player movement script that will get you started on your 3d project. Code is pinned in comments....more Walk, Run, Ju…
    Github
    D-three/First-Person-Movement-Script-For-Unity - GitHub
    This is a first person movement script for 3d games in unity. Here are some of the features in this script: Here are some requirements for the script Your player must have a Charac…
    Unity
    Player movement - Unity Learn
    In this tutorial, you’ll explore the three systems that relate to the player character’s movement: input, animation, and navigation. You’ll also investigate accessibility considera…
  2. UNITY 3D PLAYER MOVEMENT in 2 MINUTES! FPS …

    May 11, 2023 · Walk, Run, Jump and Sprint! Easily customizable! A very simple player movement script that will get you started on your 3d project. …

  3. Unity - Scripting API: CharacterController.Move

    Supplies the movement of a GameObject with an attached CharacterController component. The CharacterController.Move motion moves the GameObject in the given direction. The given …

  4. Player movement - Unity Learn

    In this tutorial, you’ll explore the three systems that relate to the player character’s movement: input, animation, and navigation. You’ll also …

  5. How to Move Player Position in 3D Unity: Beginner …

    Learn how to move player position in 3D Unity with this beginner tutorial. Covers transform and Rigidbody movement, input handling, and simple …

  6. Simple Player Movement in Unity - Medium

    Aug 12, 2025 · Creating basic player movement in Unity — such as moving left, right, up, or down — is quite straightforward once you understand the …

  7. Creating Player Movement in Unity - Sharp Coder Blog

    Learn how to create basic player movement in Unity using input handling and Rigidbody component. Follow the step-by-step guide with code examples …

  8. Make a Game in Unity - How to Move a Player in …

    Feb 26, 2023 · So you want to move a 3D object in Unity? It’s easier than you think! You can learn how to do it with a few lines of code. In this tutorial, …

  9. FIRST PERSON MOVEMENT in 10 MINUTES - Unity Tutorial

    Feb 7, 2022 · FIRST PERSON MOVEMENT in 10 MINUTES - Unity Tutorial In this video I'm going to show you how to code full first person rigidbody movement. You can use this character controller as final...

    • Author: Dave / GameDevelopment
    • Views: 1.4M
  10. Player Movement in Unity Explained: Rigidbody and …

    Aug 16, 2023 · Looking to learn how to take inputs from players and move characters around the screen? We've created this guide to showcase three …

  11. This project is a demonstration of player movement …

    This project is a great starting point for anyone looking to understand player movement and camera control in Unity. It provides a solid foundation that …