Is there a way to ignore a class when doing a LineTraceSingleByObjectType in C++?

I’m overwriting CanBeSeenFrom in my Character class because I wanted to do more specific sight checks for the AIPerception system and because I needed to ignore certain classes/in-game objects when doing the line traces. Right now I have a smoke grenade object that when used/spawned makes my AIPerception system lose sight of any actors in or behind it. The smoke grenade has a bounding volume that has a custom collision preset but is also world dynamic. So is there a way I can specifically ignore that smoke class (or maybe the custom collision preset) in the line trace?

Also this is all in C++ so any help on that end would be appreciated. Thank you!

Yes! You can create a custom profile for the actor you want to ignore and in the profile settings you can set the trace response to “ignore” for the channel type that you are tracing.

You can create the profile by going to Project Settings - > Collision (It’s in the Engine category)

Cheers!

1 Like

Great, thanks! I totally forgot about LineTraceByChannel, I should’ve been using that. Also for anyone else who would like to know, custom collision profiles that you can reference in C++ are found in the DefaultEngine.ini