I don’t quite understand what you intend to do by attaching it to the CursorToWorld. Could you be more specific?
I am going with the assumption you are using the widget in a HUD, correct? If you want to use widgets, try something like this:
- Create a canvas widget, in your [Content Browser]
- Add a button to the widget
- Click on the panel’s graph and add an OnClick event to your button (Hint: “details” panel for the button)
- Open your HUD blueprint
- At the BeginPlay node of your HUD, add these nodes:
- [Create Widget] (Set the class to the canvas panel you had just created)
- [Add to Viewport] (Connect the pins from the [Create Widget] node to this node)
- Add something to the buttom’s OnClicked event
- Run the game to see if it was all done correctly.
Does that help?