Search Unity

Character gets snagged on something invisible

Discussion in 'Navigation' started by agentc0re, Aug 12, 2016.

  1. agentc0re

    agentc0re

    Joined:
    Feb 28, 2014
    Posts:
    77
    Here's a GIF of what it looks like: https://gyazo.com/9f6440679713b251a071e935800da4eb

    So he first walks a couple of steps just fine. But then this happens. I have made sure that all colliders are above ground, the navmesh now has an base offset so that it's also not below ground. Quick note on that: The first time i changed the offset and hit play, the NPC didn't get snagged. But when I hit play again, he still got stuck in that position.

    Anyone have an Idea? Or could this be an animation issue??
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    A collider would not change the animation.

    Therefore it's simply a bad loop in the animation.

    Unless you mean movement. Colliders will only affect something moving through space from A to B.
     
  3. agentc0re

    agentc0re

    Joined:
    Feb 28, 2014
    Posts:
    77
    Well here's the weird part. If i enable and then disable the collider on his leg, he first flys like a majestic unicorn and then lands and walks for quite a distance before he gets stuck again. Could it still be an animation loop problem? The loop is very short.
     
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I see, so it's meant to be moving. In that case check that the level isn't using a mesh collider WITH a rigidbody. If it doesn't have a rigidbody, it should be fine.
     
  5. agentc0re

    agentc0re

    Joined:
    Feb 28, 2014
    Posts:
    77
    Also when i hit play, go to the scene view and once he gets stuck I move him up in the y-axis, he goes up, drops down because of gravity and then walks quite a distance before getting stuck again.
     
  6. agentc0re

    agentc0re

    Joined:
    Feb 28, 2014
    Posts:
    77
    On the sidewalk that he walks on, only box colliders exist.
     
  7. agentc0re

    agentc0re

    Joined:
    Feb 28, 2014
    Posts:
    77
    Here's another very interesting find. When i have that troll enabled and he gets stuck, if i move the player character near him, the player also gets stuck. it becomes very difficult to move around anywhere, the player almost seems to be surrounded by something.
    BUT when I disable the troll, the player can walk around in that area and everywhere else just fine. #puzzeled
     
  8. agentc0re

    agentc0re

    Joined:
    Feb 28, 2014
    Posts:
    77
    Well I can't explain it. Setup a test scene added the troll from default state, added everything it needs and it walks just fine, not getting hung up on anything.
    If i ever figure out the cause, i'll post an update here.
     
  9. IvanDonets

    IvanDonets

    Joined:
    Feb 19, 2014
    Posts:
    117
    It happens to me also (snagged on something invisible)