Ok guys, my first post here on this website. I know it's kind of a noob question but, either i'm not looking from what is in front of my eyes, or.. i don't know.
So, i want to instantiate a prefab in the same position of a trigger when i enter it.
And i have this:
So i presumed that if i attached the script to my object it would instantiate it where in the same position of my gameObject to where's the script is attached. Tommorow this will become a onCollisionEnter so that the script can be attached to a bullet and where the bullet hits, it destroys itself and instantiate my prefab, wich goes for 5 seconds and then disappeas, well that i know how to do with destroy and waitforSeconds commands. Can you solve this for me please? Thanks.
P.S. - Oh, and since i'm a noob with unity, keep it simple and stupid please. :D
P.S._2 - No need for raycasts here, the bullet is a rigid body since, well, is not a bullet, more like a missile to be shoot from a tank. :D Cheers. ;)
use #pragma strict at the top of your files and you will see that gameObject.position doesn't exist! You need to be using transform.position...
answered Jul 09 '12 at 05:16 PM