Hello, I’m just wondering on how I can spawn a prefab on Dead()
I want to get the tombstone spawned on the AI’s position here’s the code.
#pragma strict
var Tombstone : Transform;
var Health = 100;
function ApplyDammage (TheDammage : int)
{
Health -= TheDammage;
if(Health <= 0)
{
Dead();
}
}
function Dead()
{
//Drop the tombstone on position then Destroy
Destroy (gameObject);
}