Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Animations are not collided as going outside capsule colliders

Discussion in 'Animation' started by fahimalavi, May 7, 2015.

  1. fahimalavi

    fahimalavi

    Joined:
    Feb 27, 2015
    Posts:
    6
    1) I am making a game and my fighting animations are not colliding (I have tried by attaching colliders to the joints as well)? The reason seems to be that animations are going outside the capsule collider. I am thinking to rebake animations centered at 0,0,0, any other thoughts ?
    2) After receiving hit should I use general physics or any other animations ?

    Feel free to give your thoughts for any possible solution
     
  2. waythewanderer

    waythewanderer

    Joined:
    Apr 6, 2015
    Posts:
    92
    1) The capsule collider is centered at the character's center of mass. When you say the animations go out of the collider, are you talking about the character's center of animation going out of it, or is the hand and feet animations moving out out of the collider? If it is the latter, then it is very normal, and is supposed to behave this way. You can try re-baking and see of you get new results.
    2) For the receiving of hits, you have 2 options:
    a) use physics: when you want to turn the model that receives the hits to turn into a ragdoll, enabling it to be pushed away by the hits
    b) use animations: use code from your script to detect hits through collider triggers or many more of other methods
     
    fahimalavi likes this.
  3. fahimalavi

    fahimalavi

    Joined:
    Feb 27, 2015
    Posts:
    6
    @waythewanderer Yes you are right animation of hand and foot going outside from the capsule collider limit(I don't want to disturb limit) so baking is a good options.
    I also notice one thing that I can't able to apply mesh collider as my mesh size is too big ~1200 while I think that it can't be greater than 250. Is there any way to make a custum mesh collider ?
     
  4. waythewanderer

    waythewanderer

    Joined:
    Apr 6, 2015
    Posts:
    92
    You can create multiple child game objects of your main object and attach a collider for each child object. This will not provide collider geometry as accurate as mesh colliders do, but this saves you more time as compared to creating smaller multiple mesh colliders.
     
    Last edited: May 8, 2015
    fahimalavi likes this.