So I was doing the roll a ball project, and just did my code for the player movement and I tried to move with my WASD keys but I couldn’t. I looked at the input manager and my keys were WASD. I Here is my code.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour {
public float speed;
private Rigidbody rb;
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);
rb.AddForce (movement * speed);
}
}
I am puzzled why this won’t work.
Any help would be helpful.