Hi, i recently started learning Unity and I was wondering if there’s a list of commands or a guide that walks through various properties/parameters that I can override in the script: for example use the Update function in java script and add a deltatime that alters the rotation of the directional light, I am just not sure how to access them through the dot operators.
Thanks alot 
The standard documentation covers all functions in Unity.
–Eric
Oh yeah, I have checked that, however do you know how to get around the “ParticleEmmiter” and “particleEmmiter” there are problems that I am having when compiling, I am just not too sure about my way around these properties, although I did look at Hierarchy, I am still trying to write everything from highest thing… “Object.Component…etc”
rather than attaching a script to a model and typing something like transform.Roatation()…etc.
If something’s not working for you or you’re having trouble figuring out how to do something, post the specific code in question (if any) along with any error messages you’re receiving (if any) and a detailed description of the problem you’re running into.
I am attempting to implement
function Update ()
{
particleAnimator.force = new Vector3(10,0,0);
//transform.Rotate(0,Time.deltaTime*3,0);
}
script toParticle system, I am not sure though how to access particleAnimator… is it PartcileAnimator dot something dot something or Object.Component.etc?
I see some possible problems there, but there’s not enough context to really offer a conclusive answer, I don’t think. If you still need help with this, I recommend posting the script in its entirety (be sure to use ‘code’ tags, and make sure the indentation is preserved) along with any errors that you’re getting.
That’s all the code that I have
function Update ()
{
particleAnimator.force = new Vector3(10,0,0);
}
I tagged the particle system as “ParticleSystem” and named it ParticleSystem and attached this scipt to it, I am attempting to manipulate the force under “Particle Animator” in order to simulate wind.
However apparently particleAnimator is not part of unity or something:
Assets/Scripts/Wind.js(7,9): BCE0005: Unknown identifier: ‘particleAnimator’.
Is the error I receive
That’s right, ‘particleAnimator’ isn’t a field or property of MonoBehaviour, so if you haven’t declared it yourself, it doesn’t exist. (If you want to access a ParticleAnimator component attached to the object though, you should be able to acquire a reference to it using GetComponent().)
Thanks a lot!
I used
function Update ()
{
var particleAnimator : ParticleAnimator = GetComponent(ParticleAnimator);
particleAnimator.force = new Vector3(10,10,0);
}
Just as you said, but I don’t know how you came up with that? Because at first I thought scripting this would be easy… looking at unity options and just using the dot operator to get to a lower depth of options.
For example the particleEmitter seemed obvious, and since Particle Animation was right beside it, I thought all needed to do was change it to particleAnimation, but that doesn’t exist.
I am just wondering how you know how to access a specific property when you assign a script to a game object.
thanks.
First, let me ask: does the code you posted above compile and work correctly?
As for your question, assuming I’m understanding it correctly, the answer is basically, use the documentation. For example, the docs for MonoBehaviour will tell you what fields/properties/functions are available to classes/scripts that derive from it (which implicitly includes UnityScript scripts).
The code does work correctly, however I do get warnings in the console:
ArgumentException: You are not allowed to call GetComponent when declaring a variable.
Move it to the line after without a variable declaration.
Don’t use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
Wind…ctor () (at Assets/Scripts/Wind.js:3)
I guess I will try to read the documentation, the problem is, I look at Hierarchy, and it shows which option is within which, and then I try to get to that through dots. But what you’ve mentioned (GetComponent) I was like 