Hi! I’ve been trying to grasp my head around using box traces, but I can’t seem to figure out how to use them properly… (keep in mind it’s a 2D game, so Y is ignored)
Here’s the box trace:
I’m working on the AI for my game, and what I want the box trace to do is essentially “scan” for a nearby player and then walk towards him. I got the second part covered, but I can’t, for the love of me figure it out…
As you can see in the picture above, I have it set so that every tick it runs a box trace. If I leave it like how it is in the picture, everything basically works, with one exception: if the player jumps it gets out of the reach of the box trace, and the enemy doesn’t know what to do. Makes sense, right? Because in the picture when I add to the player’s location I don’t add anything in the Z.
Here’s what it looks like “fixed”:
This is where the problem lies. As soon as I have it add to the Z, it screws everything up. It doesn’t work, at all. Sometimes when I’m jumping and moving around the enemy he’ll budge a little bit but that’s about it. I have no idea what’s causing this.
Here’s how I think box traces work:

That’s what I thought I was doing in the second image, but I guess it didn’t work…
Please help! I really appreciate it.
Here’s your reward:


