I have looked at similar questions: http://answers.unity3d.com/questions/33433/Cant-access-prefabs-variables-once-instantiated.html and http://forum.unity3d.com/threads/134864-accessing-an-instantiated-prefab-s-variables but they do not solve my problem.
Say, I have a prefab called MovingSoldier
and I instantiate it as follows:
GameObject ms=(GameObject) Instantiate(MovingSoldier,new Vector3(10,32,91),transform.rotation);
MovingSoldier
has a C# script attached called SoldierScript
and the script has a variable speed
. How do I access and change the variable speed
from the object ms
I created above?