Announcement

Collapse
No announcement yet.

Mouse click event from sprite to C++

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Mouse click event from sprite to C++

    Bit of a newbie question here. I'm trying to get a mouse click on a sprite to provoke a call to C++ ideally the OnClick method on the MyActor sub-class I've created, but anywhere in the C++ world would be a start.
    I've got Visual Studio 2017 Community with all the UE4 stuff set-up on it. I can launch the UE4 engine from the compiled Visual Studio project. I've created a MyActor sub-class of AActor in the VS project.
    In the Blueprint world I've created a Player Controller that enables mouse clicks, I've created a Game Mode that selects my Player Controller as the one to use, and I've set World Settings to use my Game Mode. When you switch the game on, you have the mouse cursor and can make mouse clicks.
    However I've found no way of associating the MyActor class I've created with the sprite, so that mouse clicks on the sprite will call OnClick. There's probably quite obvious that I'm missing out. Any help would be greatly appreciated.
Working...
X