- Home /
AddExplosionForce
So this little snippet of script doesn't work. It may be the first few words.
if(Health == 0) {
gameObject.rigidbody.AddExplosionForce(power, transform.position, radius, 3.0);
}
Comment
If your using C#, put an 'f' after '3.0'. Also, whats the problem? What error are you getting?
Try if(Health <= 0)
. Otherwise, post your full code so we can troubleshoot.
I added a debug so it is spawning, but it's spawning wrong and not being effective. It's supposed to spawn where the prefab is (think a grenade) but it won't spawn at that position. This script is inside the prefab by the way.