comparing trace impacts

Hey

I’m using single line trace for objects in a blueprint. I’m feeding the on hit into a break hit.

Now I’m wanting to check to see what type of child actor the ray cast is impacting. but everything i try comparing returns false. i thought maybe i could get the class of the hit actor object and compare that to a new variable with that class assigned , but i cant find a class equals…

Any tips would be a big help

thanks

Hi ,

There are no class == or class != nodes exposed right now, we’ll add them in a future release. For now you can try using a Cast to … node instead.

Also depending on what you’re doing, you might want to explore collision channels (Collision in Unreal Engine | Unreal Engine 5.1 Documentation) and narrow your traces down to only hit things of the type you are interested in (this can also be a performance optimization). I don’t know if there is documentation about it yet, but you can define custom collision channels for your game in Edit…Project Settings…Collision.

Cheers,
Noland

Thanks

The second way is much better, I’m glad you showed me that, as that was going to be my next question.

Cheers