Hello. I am doing the example Space Shooter from tutorials and using Unity 4.3.4f1.
According to the tutorial, clones should disappear from hierarchy view but mine is still there, only the triangle on the left disappears. But I see that the Z position of the clone is increasing, so I guess the object doesn't stop. Is this expected?
I think I did everything same as tutorial. This is the code from tutorial:
public class PlayerController : MonoBehaviour
{
...
void Update ()
{
if (Input.GetButton("Fire1") && Time.time > nextFire)
{
nextFire = Time.time + fireRate;
Instantiate(shot, shotSpawn.position, shotSpawn.rotation);
}
}
...
}
public class DestroyByBoundary : MonoBehaviour {
void OnTriggerExit (Collider other)
{
Destroy(other.gameObject);
}
}
↧