background preloader

Unity

Facebook Twitter

Psychology: What are some of the most awesome psychological facts? Common Unity Gotchas | Unity Gems. There are a number of "gotchas" that hit pretty much everyone new to Unity programming. Sometimes these are due to you being new to programming in general, and sometimes it's due to the fact that Unity uses a slightly unusual method of attaching multiple scripts to a game object. This overview tries to take you through the ones we see most often on Unity Answers. The Gotchas How to access a variable or method on another script or object How to access a variable or method on another script or object There is also a really great tutorial and video on GetComponent which you can read and watch in C# or in UnityScript So you've written two scripts and you want to access variables or methods on one script from the other one, but you can't quite work out how to get a reference to the script or how to get the variable.

You may be tempted to declare variables as static so that you can access them easily without having to actually reference the object on which the script is placed. 1. In C#: 2. In C# Unity - Game Engine. Unity - Learn - Modules. Game Engine Unity Learning Resources - Virtual Game Lab. Unity Script Reference: Welcome to the Unity Scripting Reference!

This section of the documentation contains details of the scripting API that Unity provides. To use this information, you should be familiar with the basic theory and practice of scripting in Unity which is explained in the Scripting section of our manual. The scripting reference is organised according to the classes available to scripts which are described along with their methods, properties and any other information relevant to their use. The pages are extensively furnished with example code that you are free to use for any purpose without crediting Unity.

The examples can be viewed in any of the three supported languages (C#, JavaScript and Boo) using the menu at the top of each page. Subsections of the reference can be selected using the menu to the left.