I’m playing around with a Paper2D TileMap for a 2D strategy game where the player clicks on units and then on the map to give them a destination. All very, very simple.
The map is being rendered using orthographic projection and I have set up collision shapes for all the tiles in the tileset.
Currently I’m stuck at getting mouse move and click events to correctly identify which tile the mouse is over and I cannot seem to find any good tutorials/examples that show how to do this.
Does anybody know how to:
setup a Blueprint script that prints the tile coordinates over which the mouse hovers when it enters a tile?
setup a Blueprint script that handles a mouse click event identifying the tile coordinates over which the user clicked the mouse button?
to your question " * setup a Blueprint script that handles a mouse click event identifying the tile coordinates over which the user clicked the mouse button?"
I did it like this i hope it helps someone in the future
I made a thin C++ wrapper around UPaperTileMap::GetTileCoordinatesFromLocalSpacePosition
Mouse events just bypass the AActor handlers, so im using Left Mouse Button Event + Convert Mouse Location