AI Perception can see through walls

I’m working on a topdown 2D game and I have some AI behavior setup after following the Advanced AI Twitch training video. I’ve rotated all the sprites to align with the XY axes so I could utilize the navmesh for the AI. Everything has worked really well except the AI can perceive the Player through walls. I’ve turned on AI debugging so I can see where the perception extends through the wall. I can inch the player into the AI perception a little without being spotted, but if I move the player fully into the cone of vision he is seen.

Initially I thought it might be a Paper2D issue, but I replaced all the wall sprites with very large cube meshes and it did not make a difference. The AI can still see through the cubes. I’m new to Unreal so I might be missing something, but it seems like a bug.

I tried reproducing the problem in the 3D topdown template and couldn’t so it most likely has something to do with Paper2D.

Hi ryantowell,

Could you provide a small test project so we can test this issue in-house? If it’s smaller than 5 MBs you can upload it here or post a link to download it from Google Drive, Dropbox, etc.

I believe it’s all here. Let me know if you need more.

Thank you for the project. It looks like the AI Perception can see through any collision that is set to ‘BlockAllDynamic’.

To fix this:

  • Open the Wall blueprint

  • Select the Cube component

  • Then under the Details panel > Collision > Collision Preset

  • Change it to ‘BlockAll’

Let me know if that works for you.



Well, I feel silly. That fixed it. I removed the cube and set the sprite to “BlockAll” also and it worked also. Thanks for helping!