Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by johnG0709er · Nov 08, 2018 at 01:28 AM · javascriptmonodevelopvisual studiojavajavascripting

Can't add script behaviour TMP_CoroutineTween. The script needs to be derived from MonoBehaviour. I need help with this script.

I have been doing some jimmyvegas unity tutorials on youtube. he has one for a space ship game for android and ios devices, its basically an endless runner, I have made 3 sections of the endless level i want to randomise, so the game never ends, the problem is jimmy uses monodevelop, and i cant find a working version of it so im using visual studio, i created the script exactly how jimmy did and whats supposed to happen is i add a cube select trigger on box collider and throw the script into that cube, i will put the script below this message, and when you hit that cube the next random section appears. when I put it 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 jimmy teaches you how to create, 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 and the link to the video tutorial which has the bit Im stuck on is in a link below that he starts writing the script at about 3 and a half mins in, but if you watch the first 3 mins you will get the jist of what the script is supposed to do, 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.

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;

}

Link to jimmys tutorial episode 12 : https://www.youtube.com/watch?v=BTg-JHLnFno∈dex=12&list=PLZ1b66Z1KFKiLGbRHcVltFitp0gL1inbo

any help would be great,

thanks

John

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

209 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Rotate Y over time 0 Answers

Can a class array contain subclass items? 1 Answer

UnityEngine .DLL files are buried under Managed/UnityEngine/ 0 Answers

Is MonoDevelop Forever Gone Since Visual Studio Introduced in Unity 3D Ver. 5? 1 Answer

My C# scripts keep opening in Visual Studio 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges