How would I make a grid for blocks to snap to like tetris or block blast?

I’m learning unreal engine and want to make game I know like tetris ect. to help me understand the program. I have learned how to make platformer 2D games, but I’m stuck where to go from making a grid and having the block snap in the grid and not overlap each other. Any suggestions please.

If you are working in 2d space I would get the X and Y coordinates of the object and pass them through the node “Snap To Grid (Float)” (separate for X and Y).

If you are working in 3d space then there is “Vector Snapped to Grid” that takes in a vector and grid size and outputs the snapped coordinates.

1 Like