Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Not sure how to solve walking over small rocks.

Discussion in '2D Experimental Preview' started by Xelnath, Jul 20, 2016.

  1. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    402
    Hey hey,

    So, I am not sure how to solve this problem. In a nutshell, I want my character's knees and below to not count as collision when walking left/right.

    This is because they are a four legged spider with a huge gap beneath them. I use IK to position the "prongs" of the feet smoothly on the terrain. So far, so good!

    However, when I jump and land on a surface, due to the presence of the 'true' collider, about 1 unit off the ground, the character stops and the body is "squished" to the ground and never rises back to its correct hover height.

    I don't want to put a full-collider from "bottom of legs to belly" because then the creature gets stuck on small terrain objects or the whole torso shifts "up" when it moves over the terrain.

    At first, I thought an "edge" collider that I moved up/down would work. However, instead, the edge just gets caught on *everything* instead of just what was below it. Second, I tried a "2d platform effector" with 180 degrees rotation. But that ends up just working like a rigid collision box.

    Thoughts?
     
  2. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    402
    Oh - and I also tried applying a weak "upward" force while a raycast below the collider is less than 1 unit from the ground - but this ends up getting added to the "jump" force causing the jumps to go super high. Argh!

    Here's an example on a simpler character of the problem. Phalanx_WalkHeight_v0.gif