- Home /
Move armature rigidbody character
Hi, I'm working on a game with a mixture of ragdoll and animations for the character. So I added a box collider on each bone with a rigidbody in kinematic mode and interpolate with continuous dynamic collision detection.
This is how the hierarchy looks like.
My problem is that I don't know how I can move the whole character from the parent with all the rigidbodies. If I try to move the the rigidbody on the character(root transform) with Rigidbody.AddForce or Rigidbody.velocity, this will happen:
And if I try to change the position of the character with it's transform, I can't collide with world objects... So how can I move parent with multiple rigidbodies in it's children? Thankful for any help!
Answer by whosdoom · Nov 17, 2020 at 06:24 PM
Rigidbody[] bodies = GetComponentsInChildren(); foreach (Rigidbody rb in bodies) { rb.gameObject.tag = "Parca"; }
if (other.CompareTag("Parca")) {
other.gameObject.GetComponent<Rigidbody>().AddForce(-transform.right * 100000f);
}
Your answer
Follow this Question
Related Questions
RigidBody.MovePosition seems jerky in movement 0 Answers
Why is my object tilting when moving? 2 Answers
stop vehicle from moving through walls 1 Answer
Keep Horizontal Momentum after Jump 2 Answers
Prevent Rigidbody From Rotating 3 Answers