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

Resolved Collider Getting Stuck on Nothing?

Discussion in '2D' started by Tyrant7, Jul 4, 2021.

  1. Tyrant7

    Tyrant7

    Joined:
    Aug 15, 2019
    Posts:
    34
    I have a simple enemy that has pathfinding setup to follow the player. When the enemy gets close to a corner it does a collider cast to figure out it's next point of travel in the path. The collider cast doesn't seem to be hitting anything, but the enemy is stopped on the corners, and cannot move towards the next point in it's path, even though the collider cast returns blank, this could be caused by possible imprecision in the Unity collision system, but I'm not sure. Anybody have any ideas?
     

    Attached Files:

  2. Tyrant7

    Tyrant7

    Joined:
    Aug 15, 2019
    Posts:
    34
    So the solution I ended up using is just rounding the corners of the enemy's collider, which has them sliding off the corner whenever they end up stuck, it's still not the solution I was going for, but it works well enough. If anyone has anything better please do share.