I’m trying to make a 2d game like terraria, where you can build and break things, but I can barely find anything about how to break and place blocks. I have a basic 2d platformer set up with controls and a tilemap, but I cant interact with the blocks seperately. I tried making a blueprint with another sprite and destroy it but I can’t click on it. I think I need to somehow get my cursor’s location in 2d, dont know how either. I don’t want to use 3d blocks because I want to keep it lightweight. Can anyone help me?
Hello,
I haven’t touched 2D in Unreal Engine for a really long time I personally prefer creating my own Grid from scratch but this looks interesting Get Tile | Unreal Engine Documentation
To get X and Y, all you need is a Location and Floor the float value to an int. I think for 2D you only need Z,Y component of your cursor location. Use Convert Mouse Location to World Space, make sure your tilemap is at origin (0,0,0) If its not then you will need to take offset into account.
Hope this helps, I am not experienced with Unreal’s Paper tile map but this might work.