Wasd Code for Unity


using UnityEngine;


public class walk : MonoBehaviour
{
    public Rigidbody rb;
    public float ff = 1000f;

    void Start()
    {

        Debug.Log("hello world");
        
    }
    void Update()
    {
        if (Input.GetKey("w"))
        {
            rb.AddForce(0, 0, ff * Time.deltaTime);
        }

        if (Input.GetKey("s"))
        {
            rb.AddForce(0, 0, -ff * Time.deltaTime);
        }


        if (Input.GetKey("d"))
        {
            rb.AddForce(1000 * Time.deltaTime , 0, 0);
        }

        if (Input.GetKey("a"))
        {
            rb.AddForce(-1000 * Time.deltaTime, 0, 0);
        }

    }
}
Motionless Meerkat