Search Unity

Making feet stick to ground with Generic Rig

Discussion in 'Animation' started by FeastSC2, Nov 13, 2018.

  1. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    I have a few characters that all have generic rigs (they do not fit the Unity's Human Rig criterias) and I want them to have their feet meeting the ground plane even when the ground plane is angled. For this I believe I need IK but I do not have no experience with IK in Unity, only in 3d packages when creating rigs.

    What should I do to make an animated character's idle loop have his animation modified so that his feet are in contact with the ground?
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Unity doesn't have any built-in IK for non-humanoid characters (as of yet, it's in the works). So you have two solutions:
    - get an IK package from the asset store.
    - code your own IK system.

    The second is probably not that bad, there's some samples on how to do it here.
     
    florianhanke and FeastSC2 like this.
  3. FeastSC2

    FeastSC2

    Joined:
    Sep 30, 2016
    Posts:
    978
    I looked up the IK systems on the Asset Store and I thought it might be a bit of work to make it work for my own project. I have a hybrid of 2d/3d game. I use the 2d physics of Unity with 3d models.
    Anyway, I don't know that I necessarily need IK systems for what I want here.

    I thought about using blend trees instead. In my game, grounds can be angled between [-20;20] degrees. I need 3 animations per animation where the character is on the ground.
    An animation for when the:
    - ground is angled @ -20 degrees,
    - ground is angled @ 0 degrees,
    - ground is angled @ +20 degrees,

    Is that a smart approach in your opinion? How expensive are blend trees because I will need to have 3 variations of almost every animation.

     
  4. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    They're not that expensive in the long run. I'm not quite sure of the costs involved (profile if it's really important), but I assume that IK is more expensive.

    If the solution is good, though... You won't have as good results in instances where you're going from a slope to flat ground. Especially when standing on the edge of a slope, you're not going to get something that looks good by just tilting the character.
     
    FeastSC2 likes this.