Tag Info

New answers tagged

0

You can make the moveTo() function a blocking function in the user script, but you should definitely not make it block your script. This way you should have moveTo() return a boolean telling weather the destination was reached or the action was interrupted. I suppose this would be the simplest solution for the user. You cold also have the moveTo() function ...


0

It depends on whether or not you have put your script on a game object. (Monobehavior is for that purpose.) If you have not, create an instance of it the normal way. StudyScreen studyScreen = new StudyScreen(); then your update would be: void Update () { if (Input.GetKeyDown(KeyCode.Alpha1)) { studyScreen.StudyScreen(); } else ...


0

Create a public variable and make it's type the name of the class you want to access so then just assign the script with the class to your variable in hierarchy and after that you can access the variables and functions in the class. Hope that helps.


0

Source: http://www.udellgames.com/posts/ultra-useful-unity-snippet-developers-use-interfaces/ [SerializeField] private GameObject privateGameObjectName; public GameObject PublicGameObjectName { get { return privateGameObjectName; } set { //Make sure changes to privateGameObjectName ripple to privateInterfaceName too if ...


0

Basicaly, attach both scripts to the same gameobject (to make it simple) and in the MainMenu script just add the following variable StudyScreen sc; then in the Start() initialize it as follows sc = GetComponent<StudyScreen>(); at this point anywhere in your script you can reference public stuff inside StudyScreen.cs by doing sc.yourMethod(); ...


0

{ 0.000000, NaN, 0.000000 }. NaN smell of division by zero. check AnglularAcceleration () AnglAcc = new Vector3(0f,(speed * speed) / (2f * theta.y),0f); AnglAcc.Y will be NaN when theta.y =0



Top 50 recent answers are included