I have made a robot which shoots spheres.
I did this on the iphone and in the arena he is in the spheres just gather in the corners after i have shot them, how do i make them disappear after they have been shot?
I have made a robot which shoots spheres.
I did this on the iphone and in the arena he is in the spheres just gather in the corners after i have shot them, how do i make them disappear after they have been shot?
http://unity3d.com/support/documentation/ScriptReference/Object.Destroy.html
http://www.unitymagic.com/shop/en/unity-advanced-tutorial-019-destroy-objects/
You make a script and attach it to the prefab. You can call it "autoDestructor.js" or something. It will destroy your prefab after "lifespan" in seconds has passed.
JavaScript:
var lifespan : float;
function Awake() {
Destroy(gameObject, lifespan);
}