- Home /
Ragdoll get hit by
ok i have a ragdoll model of solider that walks... i want to make when it get hit by car to die...?? how :) ?
Answer by Peter G · May 19, 2011 at 08:49 PM
A bit sadistic but doable ;). You should just need to do a collision check:
//This script goes on your soldier:
function OnCollisionEnter (col : Collision) {
if(col.gameObject.CompareTag("SomeSpecialTagForTheCar") {
KillPlayer();
}
}
function KillPlayer () {
isControllable = false;
rigidbody.isKinematic = false;
}
Answer by slajmstudio · May 19, 2011 at 09:07 PM
tnx on help, but :D :
Finished compile Library/ScriptAssemblies/Assembly-UnityScript.dll Assets/skripte/vojnikauto.js(3,66): BCE0044: expecting ), found '{'.
(Filename: Assets/skripte/vojnikauto.js Line: 3)
Assets/skripte/vojnikauto.js(6,4): BCE0044: expecting EOF, found '}'.
i get some errors
The error should tell you exactly what you need to do. Go to the if() line and add a ")" before the "{"
Your answer
Follow this Question
Related Questions
How to make is kinematic false for all children of a gameobject? 1 Answer
How to effect all objects in an array 2 Answers
character fall down when die 1 Answer
Ragdoll physics going crazy on Activate 1 Answer
Timeline and Ragdoll 1 Answer