Advertisemen
Check out our YouTube Channel - Aarlangdi dotKom for short films
Hello guys, in this tutorial, I will be showing you guys how to make seed spawner flower. If you are saying what the hell. you can check this video -- http://youtu.be/B9cL2qHiONk --- that is what we are going to create today in unity 3d. If you are interested, let's go ahead and started.
I am hoping that you guys have basic knowledge about Unity3d, like creating cube, sphere, prefabs etc because I am not going to show you how to create these in this tutorial.
First create background with plane and change colour to whatever you want. Then create one sphere and name it flower and create few more sphere and make them smaller then flower sphere for leafs. Now change the other settings and position them(leaf spheres) around the main flower and make them the children of main flower. It should look like this ---
Also create one empty Game Object, name it spawner point, make it child of main flower and position it in the centre of the flower. take a look into this --
Let's create some seeds. Create some spheres, I created three for this tutorials and changed their colour to three different colours, you can create as many as you want. Now, create three prefabs and drag those three different colours sphere into prefabs individually. It should look like this.
Now, create two javascripts and name them like - spawner.js and seed.js or whatever make you easy to remember. Then type the following in spawner.js --

And following in seed.js ---
After that drag spawner.js to main flower object and seed.js into seed prefabs
Now, click on main flower and in the inspector view in script section under dust in the size type 3 and drag the prefabs into them and spawnerPoint into another one. It should look like this.
Now, hit play you flower should spawn seeds from the centre.
Here is project file, if you like to go through it.----
http://www.mediafire.com/download/sdfbdw4iolz3lx1/spawn.zip
If you have questions, leave them in the comment section.
Thanks
Advertisemen
Tidak ada komentar:
Posting Komentar