No announcement yet.

Having porblems with monbehaviour in java script any help please!

  • Filter
  • Time
  • Show
Clear All
new posts

    Having porblems with monbehaviour in java script any help please!

    Having porblems with monbehaviour in java script any help please!

    Im doing this tutorial

    and im stuck on that video when he does the randomisation script, heres the message i posted to the guy who makes the video:

    Hi jimmy when I do the script on Generate next section I get 5 errors that sais they dont like the NewAxis, TheXAxis or the NextAxis, when I put the Script on the cube it sais this error message. "Can't add script behaviour TMP_CoroutineTween. The script needs to be derived from MonoBehaviour" when looking on line ppl say you have to add a monobehaviour class to the script, but I am doing my script in java as per the tutorial and everyones answers is for C#. I dont know how to write this in Java is it var MonoBehaviour? Im a newbie I am just beginning Im one episode away from completing the game, im at a crossroads because i cant work out whats wrong, it sais it doesnt like NextAxis and TheXAxis and NewAxis. But there is no way to change it, all visual suggest is to change it from TheXAxis, NextAxis or NewAxis to Var NewXAxis : float = newFunction(); Im pretty sure that wont randomise the sections with just newFunction surely it needs to know what Axis its on to randomise the next section. The script is below, Any help would be greatly appreciated. I have worked out all other errors but i cant get my head around this one, and no one has this same problem as monodevelop still worked when this tutorial was created. now it doesnt work and the only thing you can code in is word pad and visual studio and they both give me the same errors, any help would be great. Script: var Section01 : GameObject; var Section02 : GameObject; var Section03 : GameObject; var NewXAxis : float = NextAxis.TheXAxis; var GenSec : int; var NewSec : GameObject; var NextPosition : Vector3 = Vector3(NextAxis.TheXAxis, 25.9, 16.7916); function OnTriggerEnter (col : Collider) { NextPosition = Vector3(NextAxis.TheXAxis, 25.9, 16.7916); GenSec = Random.Range(1, 4); NewXAxis = NextAxis.TheXAxis; if (GenSec == 1) { NewSec = Section01; } if (GenSec == 2) { NewSec = Section02; } if (GenSec == 3) { NewSec = Section03; } Instantiate(NewSec, NextPosition, Quaternion.identity); NextAxis.TheXAxis += 500; } any help would be great, thanks John´╗┐.

    Can any one help with this, i can send the unity project over to who ever can help, i even tried converting it to C# because that has a class that sais something about monobehaviour but still didnt work and the guy who does the tutorial hasnt got back to me, any help would be great as im at a brick wall at the moment.



    That's the Unity engine, this forum is for Unreal Engine.

    That's like going to an Apple store for help with your Dell