Best way to check hit result for switches

@ThompsonN13, that’s pretty much exactly what I was thinking. Thanks for posting that and helping out!

@CGough, the real magic of this approach is the Cast To node, which re-interprets the struck actor as a more specific sub-class — in our case, the custom blueprinted actor that I was calling ‘BP_TeleportTargetActor’ in my first response, and which is called simply ‘teleporter’ in the screenshots above.

If the cast node succeeds in casting the hit actor as the desired type, then we can call up custom events (as shown above), access custom variables, or do any number of other things. And all while keeping the blueprint scripting very minimal and clean!

Hopefully it makes more sense now. Check out this linked article on the official docs about Casting in Blueprints and this Blueprint Casting Example if you’re still new to the idea of casting.

Happy developing!