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.
3 Likes
To create a grid for snapping blocks in Unreal Engine:
- Use a 2D array to manage grid positions.
- Round block positions to the nearest grid point (
Round(GridSize)
). - Check for overlaps before placing blocks.
- Store and update grid data dynamically.
For a practical example of block-snapping mechanics, check out this game. Hope this helps—good luck with your project