It says that im missing “;” but i checked everywhere and nothing!

Updated on May 15, 2017 in [A] Brackeys Courses
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
6 on May 14, 2017
  • Liked by
Reply
0 on May 14, 2017

#pragma strict

var rotationSpeed = 100;

function Update ()
{

var rotation : Input.GetAxis(“Horizontal”) * rotationSpeed;
rotation *= Time.deltaTime;
rigidbody.AddRelativeTorque (Vector3.back * rotation) ;
}

I cannot see a missing semicolon anywhere yet it keeps telling me that its missing.
Tutorial from Brackeys: https://www.youtube.com/watch?v=N49cfP-MWJA

  • Liked by
Reply
Cancel
4 on May 15, 2017

#pragma strict; ?

If you’re using Visual studio it should tell you which line it is.

on May 15, 2017

It always says that this line”var rotation : Input.GetAxis(“Horizontal”) * rotationSpeed;”
requires semicolon. But it is there already.

Helpful
on May 15, 2017

Try something like 
var rotation = Input.GetAxis(“Horizontal”) * rotationSpeed;

I’m not sure if this will work in js, I never use that language.

on May 15, 2017

No thats not it. But thanks for the help anyways.

Devoted
on May 15, 2017

It should be like this:

var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;

Show more replies
  • Liked by
Reply
Cancel