Search Unity

Easiest Way to Set Up Colliders For Animated Blender Model?

Discussion in 'Animation' started by WilkinsMicawber, Dec 13, 2017.

  1. WilkinsMicawber

    WilkinsMicawber

    Joined:
    Jan 22, 2016
    Posts:
    27
    I'm animating models in Blender for use in Unity, and I want the animated models to be able to be used for collision detection. It appears that the primitive colliders need to be set to each bone so that the physics work during animation. Is there a way to set these primitive colliders in Blender? What is the best approach? What do you do to prepare your animated blender models for use in your game so that they can be used in collision detection?
     
    Last edited: Dec 13, 2017
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,779
    What is your desired outcome? Do you want each bone to have a collider in engine, or do you want the character to have one standard collider?
    Unity has a standard process for setting up a character that uses a standard collider. This is well documented in nearly all of the tutorials that deal with characters, and in the documentation.
    If you are looking to set up the character with individual colliders per bone - that is a more complex question - and has many different answers.
    Consider researching the asset puppet master in the asset store and ragdoll, and other threads in this forum if your desire is to set up individual colliders per bone.
     
  3. WilkinsMicawber

    WilkinsMicawber

    Joined:
    Jan 22, 2016
    Posts:
    27
    I want the game to know when the enemy's collider touches the player's, so i need the collider to be able to act as a trigger, while the enemy itself has their position controlled entirely by code. I don't know the easiest way to implement this. I tried running the animation and looking at what the mesh collider was doing, and it did not move at all. Just looking for my animated models to have hit detection that follows the movement accurately, no matter the method. The puppet master package is far more complex than i need.
     
    Last edited: Dec 13, 2017
  4. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,779
    If capsule collider will sifice - most of the tutorials in the learn section detail this process well, along with teaching how to use colliders and triggers.
     
  5. WilkinsMicawber

    WilkinsMicawber

    Joined:
    Jan 22, 2016
    Posts:
    27
    I just tried setting up the primitive capsules in blender and setting the individual bones as parents, and they don't seem to convert over to unity as children of the bones, and they aren't available as meshes. Might be easiest to set the colliders in unity itself.
     
    Last edited: Dec 14, 2017