WASD won't work
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. :D
Answer by hexagonius · Feb 04, 2017 at 10:23 AM
because it's FixedUpdate instead of fixedupdate. always camelcase.
Your answer
Follow this Question
Related Questions
C# Mouse Look Script | Why does the Y Axis Work but not the X Axis? 1 Answer
Changing (swapping) users movement controls IN GAME on trigger (2D) 0 Answers
Is there anyhow to know if the axe is positive or negation 0 Answers
My Object Won't Activate 0 Answers
Input.GetAxisRaw always returns -0.6 1 Answer