Hello guys, I got a problem with my enemy AI / ragdoll, when the enemy AI dies, he gets replaced by a prefab(ragdoll) and that works perfectly except one thing, the ragdoll spawns in the T-position and how would I do to fix that so the ragdoll spawns in the exact position as the enemy AI.
Ima post my damage/spawn Ragdoll script below
{
public GameObject RagDoll;
public float RobotHealth = 100f;
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Bullet")
{
audio.Play();
RobotHealth -= 20f;
if(RobotHealth == 0)
{
GameObject go = Instantiate(RagDoll, gameObject.transform.position, gameObject.transform.rotation) as GameObject;
Destroy(gameObject);
}
}
}
}
The AI script I'm using is from AronGranberg (The A* AI, the free version).
↧