Hi! I Have just got Unity and have experience of programming and starting to build a game
i am working on a movement script but it dosent work
Here is the script
using UnityEngine;
using System.Collections;
public class move : MonoBehaviour {
//Use this for initialization
void Start () {
}
//Update is called once per frame
void Update () {
if (Input.GetKey ("w")) {
transform.Translate((Vector3.forward) * 100 * Time.deltaTime)
}
}
“it dosent work” isn’t very helpful. What’s not working? Are you getting an error? If so, copy-paste the error(s) here so we know what is wrong. By the looks of it, you’re missing a semi-colon on the Translate line and a curly brace to close the class.
using UnityEngine;
using System.Collections;
public class move : MonoBehaviour {
//Update is called once per frame
void Update () {
if (Input.GetKey ("w")) {
transform.Translate((Vector3.forward) * 100 * Time.deltaTime); // add semi-colon
}
}
} // add a curly brace to close the class