x


CAR SCRIPT

Im trying to get my car to bosst when I press space bar and then slow down again but it say that "expecting :, '=' Here i the whole script function Update() {

Move3 () ;

if (Input.GetKeyDown ("space")) {
    var speed=70;
}
else; {
 speed = > 50;
    speed = speed -1;
}
else; {
 speed = < 50;
    speed = speed +2;
}

rigidbody.centerOfMass = Vector3 (0, -2, 0);

var speed = 50; var angle = 70; var gravity = 1000; var mass = 2000;

var centerOfMass : Transform;

function Move3 () {

var r = Input.GetAxis("Mouse Y") * Time.deltaTime * angle;
var z = Input.GetAxis("Vertical") * Time.deltaTime * speed;
transform.Translate(0, 0, z);
transform.Rotate(0,r,0);

}

REALLY NEED HEP!!!

more ▼

asked Nov 10 '11 at 08:33 AM

chewbacca666 gravatar image

chewbacca666
-4 2 2 2

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

The first issue you have is your else statements. Else statements don't need

more ▼

answered Jan 17 '12 at 11:33 PM

pudd1nG gravatar image

pudd1nG
422 2 3 7

(comments are locked)
10|3000 characters needed characters left

The issue you have mentioned is because your else statements have semicolons after them, else statements themselves don't need any semicolons, just the elements inside it. The second thing is the speed variable. You need to rethink this variable a bit more.

var = -1;

will not take one away from $var

var--;

will take one away.

If you can post more info once these are fixed I'm sure we can help :)

more ▼

answered Jan 17 '12 at 11:33 PM

pudd1nG gravatar image

pudd1nG
422 2 3 7

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4378
x512

asked: Nov 10 '11 at 08:33 AM

Seen: 1002 times

Last Updated: Jan 17 '12 at 11:33 PM