Animating an object and Trigering animation

hi I have couple of questions in regard animation

1- how can I rotate or scale an object from inside a script that is attached to another object. for example, rotating cube01 from the script that is attached to Sphere01

2- how can I trigger animation of one object from inside the script that attached to another object. (pretty much like the previous question.)

First, you have to find the object to which the script is attached. The easiest way is to make a variable of type GameObject in the controlling script and drag the target object to it in the inspector. However, you can also use GameObject.Find and other methods to get the object. You then need to call GetComponent on the target object. The type of the component is the name of the script you want to access:-

// Target script is Smoblin.js...
var target: Smoblin = smObject.GetComponent(Smoblin);

Once you have this reference, you can access public variables and functions of this script just like any other object:-

target.transform.localScale = new Vector3(a, b, c);
target.animation.Play("walk");

…etc.

Thank you very very much for the help
although now I have one more question if you don’t mind.
here is the link to the test fps game. so the problem I have now is my movements are messed up… I think this happens when I shoot the machine gun
this is the link
www.raminsh.com/FPSTest.html
take a look and see what I mean…

I don’t really know what you are referring to here. Perhaps you can describe the problem in more detail, but if it isn’t related to the original question, it would be better to start a new thread.