im trying to get my character to move. my code is (in C#):
using UnityEngine; using System.Collections;
public class PlayerMovement : MonoBehaviour {
public float speed;
void Update () {
if(Input.GetKey [KeyCode.D]) {
transform.Translate [Vector2.right * speed];
}
}
}
The error I get is error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement on the line with the transform code