Question by
AyyliensRule · Nov 17, 2016 at 12:56 AM ·
scripting problemscript.vrragdollzombie
Replace dead npc with ragdoll ?
Anyone know how to add a way to replace my dead NPC with a ragdoll? this is the health script I use in my VR zombie game. Currently it destroys the zombie and it just disappears, ideally I would like for it to make my zombie ragdoll and disappear after a minute
using UnityEngine;
using System.Collections;
public class health : MonoBehaviour {
public int actorHealth = 100;
// Update is called once per frame
void FixedUpdate () {
if (actorHealth <= 0)
Destroy(this.gameObject);
}
public void TakeDamage(int damage)
{
actorHealth -= damage;
}
}
Comment