- Home /
Best way for rigidbody enemy?
hello, what i want to is this:
i want to have an enemy that when i shot him his body will react the reason i don't want to do it with animation is that:
i want each body part to react interdependently so if i shot him in the leg his leg will react, if i shot him in the head his head will react etc.
so i was thinking about making the enemy with rigidbody (1 main rigidbody for the entire enemy and then different rigidbodys for each body part) and use some commend like Rigidbody.AddForceAtPosition on the body part when i shot him...
is that the correct way to do it? or mybe there are better ways?
i think making it my way will work but it will take long time to setup rigidbody for all body parts....
Please make sentences and insert line breaks. It is hard to follow your thought.
Answer by Fattie · Sep 10, 2012 at 01:03 PM
What you want is a "ragdoll".
it is quite easy to do in Unity3D ... search for 100s of tutorials and many documentations in Unity itself
try different methods. in fact usually, just apply force to the body. that's usually the result you want. suggest you actually try it, you'll see the result. another idea is you could have a few different force-points, and randomly pick one each time. but honestly it's so quick just "on the body" will likely be fine. good luck!!
ok looks like there's is a ragdoll wizard built-in in unity. i used it and it automatically made all of the rigidbody parts for the model. so should i go with Rigidbody.AddForceAtPosition like i said? or should i use something else? if you think i should use Rigidbody.AddForceAtPosition, how can i track witch body part to use force at? raycast mybe?
Your answer
Follow this Question
Related Questions
Low framerate on physics initialization. 0 Answers
How to stop an rigidbody enemy from jumping when chasing the player? 1 Answer
Why does this MeshCollider think it's half as thick? 2 Answers
When and when not to use kinematic rigidbody? 2 Answers
Do you have to have a rigidbody component for collision detection? 1 Answer