- Home /
Storing duplicated gameobject in array
hello guys! i am currently doing a piano game kinda similar to taptap. When i click play, the green cylinder object will move forward, toward the piano key. and when user press on the key, the cylinder will then be destroyed. I was thinking if i could store the 3green cylinder into an gameobject[] array, so when the gameobject is called, it will move forward. However instead of sending out the actual cylinder, can send out a duplicate one instead of the real one? Or is there other way i could do this? Thanks in advanced!
Answer by g__l · Oct 28, 2015 at 01:19 PM
You could create prefabs to store your game objects, stored in your project, then instantiate them into your game. This should help you understand http://docs.unity3d.com/ScriptReference/Object.Instantiate.html or video tutorial https://unity3d.com/learn/tutorials/modules/beginner/scripting/instantiate
Your answer

Follow this Question
Related Questions
Multiple Fire Points 2 Answers
Prebuilt gameobject bundles without Prefab instancing behavior. 0 Answers
Placing object with ray cast 3 Answers
GetAxisRaw() Ignoring Second Item 1 Answer