Monday, 19 January 2015

Unity 3d spawn a prefab




Unity 3d spawn a prefab





Making free platform game ! One man show
----------------------------------------­­­--------------------------------------­-­-­------------------------------------­----------------
Javascrip: GOOD 4 2D GAMES AND 3D GAMES ! 
----------------------------------------­­­--------------------------------------­-­-­------------------------------------­----------------

var node1 : Transform;
var block : GameObject;
var spawning : boolean = true;

function Start () {
spawnBlock();
}

function Update () {

}

function spawnBlock () {

while(spawning) {
yield WaitForSeconds(1);
Instantiate(block,node1.transform.positi­on,node1.transform.rotation);
}
}




----------------------------------------­----------------------------------------­-

Copyright Free Music in this video by:

Song: Virtual Riot - Energy Drink
» Download:
http://bit.ly/RebornDownload

Creative Commons License
http://creativecommons.org/licenses/b...

--------------------------------------

Artist's Links:
Virtual Riot - Energy Drink

http://www.facebook.com/virtualriotmusic
http://www.soundcloud.com/virtual-riot

0 comments:

Post a Comment