2D A* enabled game object falls through ground with gravity


So I have a game object that has a 2D box collider, Rigidbody 2D, and some form of A* script (I’ve tried AI Path and AI Lerp). This game object is set to have a gravity of -20 on the Y axis… However, whenever gravity is turned on, the Game Object ignores any and all 2D colliders and drops through the floor.

I am using Tilemap colliders… which is basically the same as box colliders.

What am I doing wrong?


It sounds like you are trying to make a sidescrolling 2D game. The AIPath script is written for top-down movement, so it will not work well for a side scrolling game. The AILerp script works for that, but it does not use gravity of any kind. Unfortunately there are no built-in movement scripts for this scenario, but here is the tutorial for writing a custom movement script which may help you: https://arongranberg.com/astar/docs/custom_movement_script.html