How to Make Button Click with Mouse Hover

No worries at all, this is precisely how video games are developed! It’s all about a process of constant iteration.

The reason it was always printing out false for you is that it was only designed to work if you were within the collision range, it was my fault . If you want it to activate from anywhere simply by touching it, try using the following configuration:

Go to Project Settings and create a new Object Channel with the value of Block.

Although we are already checking to ensure interaction is only possible with certain actors, I think adding this will make it neater (more organized).
In your BP_Firstperson, use the Get Hit Result Under Cursor for Objects node


you can also use the one mentioned above, Get Hit Result Under Cursor by channel

Try whichever one you like best for your game.

  • Then, in your button’s Blueprint, make the following modifications:
  • On your Static Mesh, use On Begin Cursor Over and On End Cursor Over.
    Change the Collision Preset to Custom and select the one you created previously.

Also remember to enable the “enable mouse over events” option in the player controller.

Now everything should work properly, Let me know if it works!!