# How can I do grid based movement?

**URL:** <https://forums.unrealengine.com/t/how-can-i-do-grid-based-movement/407682>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [October 22, 2017, 11:57pm UTC](https://forums.unrealengine.com/t/how-can-i-do-grid-based-movement/407682 "2017-10-22T23:57:02Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tafonath](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tafonath](https://forums.unrealengine.com/u/Tafonath)\
**Post date:** [October 22, 2017, 11:57pm UTC](https://forums.unrealengine.com/t/how-can-i-do-grid-based-movement/407682/1 "2017-10-22T23:57:02Z")

</div>

Basically i want to achieve something like this [- YouTube](https://www.youtube.com/watch?v=s9CIMnBqOPo) but without space between tiles, I want my character to jump from center of one tile to center of another. (only in certain levels, in every other i want him to move like regular 3rd person)

I don’t know where to start, everything i found is trun-based mouseclick only.  
I feel like moving actor by X points in certain axis/direction is wrong approach.

---

<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:** [October 23, 2017, 7:12am UTC](https://forums.unrealengine.com/t/how-can-i-do-grid-based-movement/407682/2 "2017-10-23T07:12:48Z")

</div>

Create a grid of actors using 2d Grid Execution Macro. When you want to move your pawn, trace to the object you’re planning to move to and get its location. Use a _Timeline_+_Lerp_ / _Tick_+_Interp_ to shift the Pawn to that tile.

> I don’t know where to start,  
> everything i found is trun-based  
> mouseclick only. I feel like moving  
> actor by X points in certain  
> axis/direction is wrong approach.

Perhaps it is not wrong but might prove quite inflexible further down the line. Essentially, before you move, you should obtain as much info about the object you’re moving to as possible. This will allow you to handle behaviour before the transition, rather than on arrival.

---

<div class="post-metadata">

**Author:** ![Mhousse1247](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mhousse1247](https://forums.unrealengine.com/u/Mhousse1247)\
**Post date:** [October 23, 2017, 2:09pm UTC](https://forums.unrealengine.com/t/how-can-i-do-grid-based-movement/407682/3 "2017-10-23T14:09:22Z")

</div>

Check out my Sokoban template [Here](https://goo.gl/sNEXdQ) , it covers grid movement.

---

<div class="post-metadata">

**Author:** ![Tafonath](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tafonath](https://forums.unrealengine.com/u/Tafonath)\
**Post date:** [October 26, 2017, 11:15pm UTC](https://forums.unrealengine.com/t/how-can-i-do-grid-based-movement/407682/4 "2017-10-26T23:15:00Z")

</div>

i created what i wanted based on your project and it works great, thanks !

---

<div class="post-metadata">

**Author:** ![Tafonath](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tafonath](https://forums.unrealengine.com/u/Tafonath)\
**Post date:** [October 26, 2017, 11:21pm UTC](https://forums.unrealengine.com/t/how-can-i-do-grid-based-movement/407682/5 "2017-10-26T23:21:54Z")

</div>

any way to make grid and keep it in the editor? (in case i want to build level around it)  
by keep it i mean visible in the editor all the time not only when i press play

---

<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:** [October 27, 2017, 1:08am UTC](https://forums.unrealengine.com/t/how-can-i-do-grid-based-movement/407682/6 "2017-10-27T01:08:16Z")

</div>

Sure, add components in the ConstructionScript:

 ![218073-grid.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/e/9/4e9b15bd46919b11bdfe9c4990d14f4ce92b8cca.jpeg)

And place the object in the level.

---

<div class="post-metadata">

**Author:** ![Tafonath](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tafonath](https://forums.unrealengine.com/u/Tafonath)\
**Post date:** [October 27, 2017, 2:40pm UTC](https://forums.unrealengine.com/t/how-can-i-do-grid-based-movement/407682/7 "2017-10-27T14:40:47Z")

</div>

that works great, thank you.  
but here comes another problem, how can i interact with each cube?  
before i had events now i have no idea how to for example change material if my character hits cube

---

<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:** [October 27, 2017, 3:17pm UTC](https://forums.unrealengine.com/t/how-can-i-do-grid-based-movement/407682/8 "2017-10-27T15:17:25Z")

</div>

In the _ConstructionScript_, add the components to an array and register them in _Event BeginPlay_ with the necessary Events you want to you use:

 ![218126-spawnedcomponents.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/7/71705bef4f8a0096efbe19bd1a1254cbf5c3b001.png)

In this case, the components now have a chance to respond to clicks and overlaps. (enable mouse click events in the controller, too)

For example:

 ![218128-setmat.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/7/6/c76d962fc7d4a3d05e1646cf7e2526a80a2c9309.png)

> **[Gyazo](https://gyazo.com/af163f92aea238af41ae41eba32e1a07)**
>
> Easily capture screenshots, GIFs, and replays that are ready to share. Download the free app for windows and mac.

In your Pawn/Character you must have a collider, use it to identify world elements you overlap with:

![218127-capsule-overlap.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/3/a/f3a78311dd4f5e8383eb44735556ff10dee83a25.png)

---

<div class="post-metadata">

**Author:** ![ChrisDondada](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ChrisDondada](https://forums.unrealengine.com/u/ChrisDondada)\
**Post date:** [February 4, 2025, 4:42am UTC](https://forums.unrealengine.com/t/how-can-i-do-grid-based-movement/407682/9 "2025-02-04T04:42:20Z")

</div>

Noob Warning. looking to do similar movement as chess but having trouble finding tutorials in blueprints. if you can point me in the right direction would be great.

tried some chess assets to see how they are built but over my head hoping for something more beginner friendly.
