movement

hello guys, i know only this script for movement ,now my player go left and right and this is not okay because player moves slowly like a ball , and i want that he moves fastly from left to right . can you modify the script?:

using UnityEngine;
using System.Collections;

public class basicmovementunity : MonoBehaviour {

    public float speed;               

    private Rigidbody2D rb2d;       

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

   
    void FixedUpdate()
    {
      
        float moveHorizontal = Input.GetAxis ("Horizontal");

       
        float moveVertical = Input.GetAxis ("Vertical");

      
        Vector2 movement = new Vector2 (moveHorizontal, moveVertical);

       
        rb2d.AddForce (movement * speed);
    }
}
1 Like

This might sounds obvious, but can’t you just increase the speed?

Do you want it easy or better but difficult?

If you want it difficult go to YouTube and search for: 2d Movement Brackeys. On the Thumbnail there is a Fox.

Enjoy and have Fun :wink:

Oh wait sorry it’s easy

using UnityEngine;
using System.Collections;
public class basicmovementunity : MonoBehaviour {
    public float speed = 30f;             
    private Rigidbody2D rb2d;     
    void Start()
    {
      
        rb2d = GetComponent<Rigidbody2D> ();
    }
  
    void FixedUpdate()
    {
    
        float moveHorizontal = Input.GetAxis ("Horizontal");
      
        float moveVertical = Input.GetAxis ("Vertical");
    
        Vector2 movement = new Vector2 (moveHorizontal, moveVertical);
      
        rb2d.AddForce (movement * speed);
    }
}

You don’t specified the Speed it’s

public float speed = 30f;