how to make a simple character controller in unity

public float speed;

    private Rigidbody2D rb2d;

    void Start()
    {
        rb2d = GetComponent<Rigidbody2D>();
    }

    void Update()
    {
        float moveHorizontal = Input.GetAxis("Horizontal");
        float moveVertical = Input.GetAxis("Vertical");
        Vector2 movement = new Vector2(moveHorizontal, moveVertical);

        rb2d.AddForce(movement * speed);
    }
}
//make sure to attach a rigidbody to the character, and you can mess around with it

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
character controller unity 3d tutorial unity should i use character controller character controller in unity how to do a character controller in Unity basic 3d unity character controller should you use character controller unity when to use character controller unity unity character controller how does it work how to character controller unity how to use character controller component unity making a physics based character controller unity use character controller unity making a character controller unity unity should you use the character controller character controller unity tutorial how unity character controller works How tuo use character controller unity how to make a player with character controller in unity tutorial Character Controller unity unity built in character controller how to make a character controller in unity unity how to make a character controller make a character controller unity character controller unity example how to create a character controller unity unity character controller code how to make a character controller in unity 3d how to use the Unity built in character controller unity character controller component tutorial unity use character controller unity simple character controller simple character controller script unity unity create character controller unity character controllert unity character controller tutorial should you use the Character Controller unity unity character controller explained unity basic character controller download character controller unity manual how to make a 2d character controller in unity unity basic character controller unity 3d character controller simple character controller script unity 3d unity character controller 3d unity creating a custom character controller how to use character controller unity unity character controller unity character controller example unity custom character controller unity making character controller 3d character controller unity simple how to make a simple character controller in unity
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source