Hi there experts. Please enjoy a wry smile at my newbie confusion. ![]()
I’m doing some early tests on Unity3.0 iOS with C#. I have managed to create a builtin Array of Objects and populate it with Objects spawned from a prefab in the assets folder at runtime using the return results from Instantiate() in a for loop on Start(). The prefabs spawn correctly into the game world with random positions.
I’d now like to manipulate those Objects using Rotate() Translate() within the Update() etc…
myArray[0].transform.Translate(1.0f,0.0f,0.0f);
Q1. The Objects referenced by the array don’t seem to allow for this. Do I need to cast differently or use getCompenent or something similar?
Q2. Why does Instantiate() return an Object data type, not a GameObject? I thought Instantiate cloned asset prefabs, and a prefab was a GameObject.
Many thanks for any advice!
Richard