I'm working through the Unity Game Development Essentials textbook and want to add in a trap that steals the player's batteries if they come into contact with it.
I have the trap deducting a charge on collision, but I'm stuck on the instantiation of objects.
I want to instantiate one of my prefabs and have it fly out of the player as it does so (so they can follow it and see where it landed)
I'm using the code from here: http://unity3d.com/support/documentation/ScriptReference/Object.Instantiate.html
But I'm not sure how to define a prefab in the variable.
Second question is, does my prefab need a rigidbody for me to 'launch' it out of the player?
asked Jul 14 '10 at 12:54 AM
If you want to define a prefab, write the following line at the top of your script:
answered Jul 14 '10 at 01:15 AM