Get Object Under Cursor Not Working

I’m trying to get the object underneath the cursor when the player hits a button, then print yes if it’s an object of a certain type. This compiles but even when i click over the correct objects it always prints ‘nope’. Any ideas to what is going wrong? I am using the basic FPS template from unreal.

Thanks for the responses! I am now doing it via the object array as above, it consistently prints ‘Static Mesh Actor’ over any object in the scene. I have some purple objects in the scene that all inherit from one class (BP_Electric). Even when clicking on them, the casting to that class seems to fail. Is there something wrong with the way I’m casting to this class? Or something collision related?