Line Trace Doesn't Collide With Characters

I have an entity in my game that I want to be killed by a flashlight. I tried setting up a line trace by channel so that when it collides with the enemy it destroys the actor, but the enemy doesn’t collide with the line trace. It is a character blueprint for the enemy. I tried adding the interface to other objects in my game to see if it works, and everything else is destroyed when I add the interface, everything except for the enemy. The enemy also HAS to be a character, because I need it to be able to move around and chase the player. Any help would be appreciated, thanks.

You’re using the “visibility” trace channel on your line trace. Either switch to “camera” or create your custom one.

Here’s a tutorial on custom trace channels, if you choose to go with that:

Additionally, make sure to check if the hit actor is enemy by either comparing the display name or tags (they should be actor tags btw)

Hope this helps! :innocent:

I ended up figuring out the issue. In the blueprints for the enemy, the line trace settings were set to “block” but in the editor they had all defaulted to “ignore” which is why no matter what I kept changing around and doing it wouldn’t work :sweat_smile:

Evidently for characters the defaults in the editor is ignore and changing it in the viewport doesn’t actually change it.

What do you mean by defaults? Which defaults? Yes by default, the visibility trace channel is set to ignore pawns. That’s why I suggested using the camera trace channel, which blocks them by default. But it’d also work if you changed the visibility trace channel to block pawns.

It’s not quite clear what didn’t work for you and what you ended up doing, but glad you got it working now :innocent: