- Home /
Keeping characters within Fighting area
Howdy,
So have a bit of a custom / strange setup here.
1) I have an arena that 2 characters are fighting wtihin. I have box colliders setup all around the arena to theoretically keep the characters contained wtihin. The box colliders are simple, static nothing fancy.
2) characters are moved around via standard character controller component with root motion-based animations (via mecanim) being used as well. I do have ragdoll rigid body hierarchy setup on the characters, but that doesn't actually do 'anything' while mecanim is active...
All works perfectly fine, UNTIL I run into situations where the root motion animation projects the character(s) through the collision areas of the outer ring.
For example, we have a body slam or throw - the target (thrown) character might end up overlapping or outside of the ring after the root motion animation completes. Mecanim adjusts / resets the base transform / character controller fine to the characters new 'end position', but the collision / physics system doesn't seem to do ANYTHING about the resulting overlapped collision objects.
I expected that the physics system would 'correct' itself and at least attempt to keep the charactercontroller object so that it doesn't overlap with the main arena box colliders, but nothing seems to happen.
Any ideas?
Answer by gekidoslair · Nov 13, 2014 at 07:07 AM
Just ended up keeping a min/max bounds and checking the player's position. if it exceeds the min/max, then I slerp them back into position.
very annoying, still not sure why the collision system doesn't work in this scenario.
I'm currently having a very similar issue. $$anonymous$$y collisions don't work even at the start of my game though. I do not have a character controller component on my character, but I do have a capsule collider attached. Not sure where to go next, but I think we could solve this problem together. I have been doing the same checking position and slerping as you but I refuse to believe this is the right answer for it.
Your answer
Follow this Question
Related Questions
Have root motion control the y axis on a character controller 1 Answer
When Root Motion anims reset character position, collision objects are ignored 1 Answer
FPS Character Controller with the push DOWN rigidbodies ability 0 Answers
How does the Animator drive Rigidbody with root motion (in detail)? 1 Answer