Help with UCE0001: ';' expected. Insert a semicolon at the end.
The error message says that the error is at 33,61. the issue being that line 33 ends at col.58, with a semicolon.
Any assistance would be very much appreciated, thanks.
EDIT: Due to the pragma strict not being in the code preview here, the error would appear on line 31 here.
pragma strict
var rotationSpeed = 100;
var jumpHeight = 8;
private var playOnce = true;
var Hit1 : AudioClip;
var Hit2 : AudioClip;
var Hit3 : AudioClip;
private var isFalling = false;
function Update () {
//Ball Rotation
var rotation : float = Input.GetAxis ("Horizontal") * rotationSpeed;
rotation *= Time.deltaTime;
GetComponent.<Rigidbody>().AddRelativeTorque (Vector3.back * rotation);
if (Input.GetKeyDown(KeyCode.W) && isFalling==false)
{
GetComponent.<Rigidbody>().velocity.y = jumpHeight;
playOnceTrue();
}
isFalling= true;
}
function OnCollisionStay ()
{
if (playOnce == true)
{
var theHit = Random.Range(0,4);
if (theHit ==0) {
GetComponent.<AudioSource>() clip = Hit1;
}
else if (theHit ==1) {
GetComponent.<AudioSource>().clip = Hit2;
}
else {
GetComponent.<AudioSource>().clip = Hit3;
}
GetComponent.<AudioSource>().Play();
playOnce = false;
}
isFalling=false;
}
function playOnceTrue() {
yield WaitForSeconds (0.5);
playOnce = true;
}
Answer by Mehul-Rughani · Mar 25, 2016 at 06:20 AM
GetComponent.() clip = Hit1; I think you forgot "." brfore the clip on line no 31 GetComponent.().clip = Hit1;
Hope it helps you.
That's exactly it. Thank you.
I don't know how long I was staring at that for with no progress
EDIT: I have no idea how to mark this as successfully answered, I can't see the checkmark anywhere
Your answer
Follow this Question
Related Questions
problems with mopub 0 Answers
Errors in my script 0 Answers
The body of '' cannot be an iterator block because 'void' is not an iterator interface type??? 2 Answers
Errors With Game Over Script 1 Answer
Unexpected Symbol? Socorro! 1 Answer