Why is OnClicked for my BP object working differently when mouse cursor is shown and when it is not shown?
![alt text] : /storage/temp/16787-screem_off.png
I want you to try something for me! While you're in your game, hit the Windows Key (or shift+F11). That'll make your cursor visible again. You'll see that the cursor usually isn't in the center, where you expect it to be.
The reason is that 'hide mouse cursor' literally just hides the mouse cursor. It doesn't 'hold' the cursor in the center of the screen, which is what you'd expect when you see the red crosshair and don't see the mouse. So when you see the crosshair over the desk, the mouse is probably off in the corner of your screen somewhere. That's why it doesn't work when you click.
That means, rather than the OnClicked node, you should do a Line Trace whenever you click Left Mouse Button. If the Line Trace collides with a Desk, then the desk is turned off or on. I think you'll find that fixes your problem neatly.
answered Oct 02 '14 at 08:58 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here