- Home /
Details of javascript words.
Hi, I'm new to unity 3d and I was just wondering if anyone know where kinda like a dictionary for javascript could be found. With a description of the word and its use. Any pointers as to where I could find such info. It would grandly be appreciated. Thank you for your time.
Answer by AlucardJay · Nov 12, 2012 at 09:59 AM
What you are looking for is the Unity Scripting Reference : http://docs.unity3d.com/Documentation/ScriptReference/index.html
Use the search box in the top-left corner.
For example, search transform , then click on the first result : http://docs.unity3d.com/Documentation/ScriptReference/Transform.html
All of the variables and functions associated with that command are there. Click on position, and the description is there.
Lets try another : rigidbody : http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.html
click on velocity, and the description and an example is shown.
Another very useful one is raycast , this time click on Physics.Raycast : http://docs.unity3d.com/Documentation/ScriptReference/Physics.Raycast.html
The Unity Scripting Reference is very handy for checking what should be included in a command, e.g. with the RayCast link :
static function Raycast (origin : Vector3, direction : Vector3, distance : float = Mathf.Infinity, layerMask : int = kDefaultRaycastLayers) : boolean
this is basically saying :
if ( Physics.Raycast( start position as Vector3, Direction as Vector3, Distance as Float, Layermask [click on layermask for more info] ) ) : Returns a boolean (true or false)
See how you go =]
I was more looking as in a list of all the words cause i do not know more then half of them i think. So I wouldn't really know what word to look for.
But thank you very much still a very useful pointer.
I know what you mean. When a person doesn't even know a command exists it is hard, and you could be doing something the long way!
The Unity Scripting Reference can still help finding some of those commands. e.g. type Vector3 into the search box
there is the first result : http://docs.unity3d.com/Documentation/ScriptReference/30_search.html?q=Vector3
this list shows some combinations of Vector3 with other commands (like Vector3.forward , Vector3.Lerp , Vector3.magnitude , Vector3.normalized )
then click on the first result : http://docs.unity3d.com/Documentation/ScriptReference/Vector3.html
this shows all the variables that are a part of Vector3. Click on one for a description and an example.
I really don't think there is just a list of all commands, the API (Script Reference) is what everyone uses. I even did a search for you, and the only results were the same as the info I have provided : http://answers.unity3d.com/questions/51522/java-script-command-list.html : http://answers.unity3d.com/questions/23759/list-of-pre-defined-functions-like-update-and-ontr.html : http://forum.unity3d.com/threads/75739-Where-can-I-find-a-list-of-unityObject-methods-%28functions%29
Another way to learn about the existance of commands is just to read the questions on this 'site. For example, I didn't know Quaternion.LookRotation existed until reading a question.
But it is there in the API ! : http://docs.unity3d.com/Documentation/ScriptReference/Quaternion.html
That is the best advice I can give. If you have a problem or think there is a better way to write your code (a command you don't know exists), then ask a question, I'm sure someone here could help. Happy Coding =]
When I've done the search myself before I got the same results. Reason why asked the question so i guess we were both on the same page there. :P Thanks for doing the search as well. :)