# How to generate a grid? VERY beginner question

**URL:** <https://forums.unrealengine.com/t/how-to-generate-a-grid-very-beginner-question/750376>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [January 16, 2023, 8:26am UTC](https://forums.unrealengine.com/t/how-to-generate-a-grid-very-beginner-question/750376 "2023-01-16T08:26:13Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [January 16, 2023, 9:27am UTC](https://forums.unrealengine.com/t/how-to-generate-a-grid-very-beginner-question/750376/3 "2023-01-16T09:27:23Z")

</div>

2D Grid Execution macro. Couple of examples:

> [@can blueprints be used to chop an image into pieces?](https://forums.unrealengine.com/t/can-blueprints-be-used-to-chop-an-image-into-pieces/104930/2):
>
> See if you can adapt the following to your needs: A material for the actors. It takes 3 scalar values - U, V and Size. UV is going to shift the coordinate and Size dictates the number of pieces. A \*PuzzlePiece \*actor that has a simple cube (with Z scaled down to make it flat), a Dynamic Material Instance is going to be fed data when the actor is spawned - the U, V and Size are variables ExposedOnSpawn The \*LevelBlueprint \*spawns PuzzlePieces. The 2D …

> [@How can I do grid based movement?](https://forums.unrealengine.com/t/how-can-i-do-grid-based-movement/407682/6):
>
> Sure, add components in the ConstructionScript: And place the object in the level.

> [@How do I get mouse clicked position on chessboard mesh](https://forums.unrealengine.com/t/how-do-i-get-mouse-clicked-position-on-chessboard-mesh/88592/5):
>
> [QUOTE=Loucsam;686801] I’m not sure I can count on each square (of the image material) being exactly the same width or height right across the board, even though by eye it appears uniform. I might have to do some pixel colour interrogation if we are close-ish to a border of 2 squares and make an intelligent guess or perhaps just deny the click if it is within say about 5% of the border. [/QUOTE] The lack of accuracy might be caused by the fact that inverse transform gives you the coordinates …

---

_[View the full topic](https://forums.unrealengine.com/t/how-to-generate-a-grid-very-beginner-question/750376)._
