Random Seconds

Hey guys. I have this script where my Player moves to certain points. I’m trying to make it so the Player moves there at certain seconds, decided by predetermined seconds in a int group. However, I keep getting this error: Assets/Scripting/Enemy/Move.js(7,34): UCE0001: ‘;’ expected. Insert a semicolon at the end.

Any help?

The script:

var roomNodes : Transform[];
var seconds : int[];
 
function Start() {
         i = Random.Range(0, roomNodes.Length);
         x = Random.Range(0, seconds.Length);
         yield WaitForSeconds(x){
         transform.position = roomNodes*.position;*

transform.rotation = roomNodes*.rotation;*
}
}

This:

 yield WaitForSeconds(x){
      transform.position = roomNodes*.position;*

transform.rotation = roomNodes*.rotation;*
}
Should actually be this:
yield WaitForSeconds(x);
transform.position = roomNodes*.position;*
transform.rotation = roomNodes*.rotation;*

[Check out this page to see how yield\WaitForSeconds works.][1]
[1]: Unity Script Reference – Overview: Coroutines & Yield

You’re using WaitForSeconds wrong.

Check the docs: Unity - Scripting API: WaitForSeconds