Quantcast
Channel: Questions in topic: "gun"
Viewing all articles
Browse latest Browse all 592

ragdoll force trouble

$
0
0
i have it so when my enemy dies it instantiates a ragdoll and i add force to it but it always goes left its supposed to be relative but its very strange this is my code for the enemy dying but it doesnt add the force to the right direction var Health = 100; var ragdoll : GameObject; var ragspawn : Transform; function Update () { if(Health <=0) { Dead(); } } function ApplyDamage (damage : int) { Health -= damage; } function Dead() { Destroy (gameObject); var ragdollClone = Instantiate(ragdoll, ragspawn.position, ragspawn.rotation); gameObject.Find("rag_root").rigidbody.AddRelativeForce(-transform.forward * 3000); }

Viewing all articles
Browse latest Browse all 592

Trending Articles