Right now i get the this error when pressing the play button:
-Assets/Movement new.js(2,14): UCE0001: ‘;’ expected. Insert a semicolon at the end.
This is the Script:
using UnityEngine.Transform;
function Start () {
}
function Update () {
if (Input.GetButton("Forward"))
Transform.Translate(Vector3.forward);
}
when i put a ; after the identifier “using” like Unity tells me to. (Which would make no sence.)
I get the following errors:
-Assets/Movement new.js(9,27): BCE0020: An instance of type ‘UnityEngine.Transform’ is required to access non static member ‘Translate’.
-Assets/Movement new.js(1,1): BCE0005: Unknown identifier: ‘using’.
-Assets/Movement new.js(1,20): BCE0034: Expressions in statements must only be executed for their side-effects.
So i can’t figure out whats wrong, i just started scripting, and i believe everything in there is right. (Although i am appearantly horribly wrong.
If there is something wrong with it please tell me, it’s kinda really bugging me.
EDIT: thanks everyone, it’s now fixed, but now i have another problem, i added some stuff, and now it gives me an error about a non-existant line, how can i solve this?
Updated script:
import UnityEngine.Transform;
function Start () {
}
function Update () {
if (Input.GetButton(“Move Forwards”))
transform.Translate(Vector3.forward);
{
if (Input.GetButton("Move Backwards"))
transform.Translate(-Vector3.forward);
}
Accompanied By the error:
Assets/Movement new.js(16,1): BCE0044: expecting }, found ‘’.
That’s what i find weird, since there is no sixteenth line.
This happend to my previous scripts as well, making them all unuseable.
EDIT2: Nevermind, i managed to fix it.