Interact with a single tile

I want to interact with each frame separately in the tilemap in the picture above. When the tile is clicked, a widget blueprint will open and I am trying to add an actor to the tile with buttons. To detect clicks, I used line trace as in image 2. I cannot adjust the positions of the buttons as I want or select the frame.

It is not clear what you want. Do you want the four buttons to appear around the selected tile and then these buttons control which actor is spawned in the tile?

This is exactly what I want. I would be very happy if you help. I’ve been trying to do this for a while. (I just started learning)

Hey there @eyupsarkisla! Is this a paper2D tilemap or is this just a 3D plane? If it’s Paper2D you could use a trace like you have and Get Tile, and iterate from there. However If it’s just it’s own plane, you may have to do some grid math or use the face location.

Get a reference to the tile from the line trace.
Use ProjectWorldToScreen to get it’s position.
Find out how big the tile is on the screen, or calculate it based on tile world size/scale and distance from camera.
Pass these to the widget.
You could use setRenderTransform and maths to set the position of each button.
Attach functions to each button that use createActor at the position of the square.

I think that should work or at least get you close.

1 Like