Question by
rajhansuttamksirsagar · May 28, 2016 at 07:59 AM ·
gameobjectcubes
how to place gameobjects in Unity while in gameplay
I have created a game of cubes, the cube is player and other color cubes are collectible items..
But Now I want to add cubes of size 1x1x1, in the game. so that I can stack them, just like in minecraft...
can anyone tell , what should be my approach to that???
Comment
Best Answer
Answer by JedBeryll · May 28, 2016 at 08:57 AM
http://docs.unity3d.com/ScriptReference/Object.Instantiate.html This explains exactly what you need. Basically you have an original object and with Instantiate you copy that object. That can be a GameObject assigned in the inspector or loaded with Resources.Load or GameObject.CreatePrimitive() or many other things.
Your answer
![](https://koobas.hobune.stream/wayback/20220612081758im_/https://answers.unity.com/themes/thub/images/avi.jpg)