So for a while now I’ve been trying to implement some simple AI behavior for a basic Goomba-type enemy such as having the enemy turn around and walk in the other direction when they hit a wall or reach the end of a ledge. To help myself out, I’ve been following this video here [Link] which uses collision boxes to fulfill both behaviors.
The problem is that I’m rather hesitant about using collision boxes, largely because in the past I tried using a collision box for my player character jumping on enemies and I ended up having issues with the collision box not being able to react fast enough. I’m not sure if I need to worry about that with just an enemy walking into a wall or not but I’d rather use line/box tracing instead as that’s what I used from the jump collision and it works perfectly.
Unfortunately, the video doesn’t explain how to use line/box tracing for this, although it does mention it. I tried modifying the jump collision logic in conjunction with the stuff shown in the video but I can’t get it work at all.
Can anyone please help me out with this?
Thanks in advance!