this is the code, i dont know why its
public class PlayerController : MonoBehaviour
{
public float speed = 5;
public float horizontalInput;
public float verticalInput;
public Rigidbody2D rb2D;
// Start is called before the first frame update
void Start()
{
rb2D = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update()
{
verticalInput = Input.GetAxis("Vertical");
horizontalInput = Input.GetAxis("Horizontal");
rb2D.MovePosition(rb2D.position + Vector2.down * speed * verticalInput * Time.deltaTime);
rb2D.MovePosition(rb2D.position + Vector2.right * speed * horizontalInput * Time.deltaTime);
}
}