# Help Debugging Maze Generator: MazeGrid Not Updating, Walls Only Spawn

**URL:** <https://forums.unrealengine.com/t/help-debugging-maze-generator-mazegrid-not-updating-walls-only-spawn/2650546>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [August 24, 2025, 5:29pm UTC](https://forums.unrealengine.com/t/help-debugging-maze-generator-mazegrid-not-updating-walls-only-spawn/2650546 "2025-08-24T17:29:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EyePatch](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EyePatch](https://forums.unrealengine.com/u/EyePatch)\
**Post date:** [August 24, 2025, 5:29pm UTC](https://forums.unrealengine.com/t/help-debugging-maze-generator-mazegrid-not-updating-walls-only-spawn/2650546/1 "2025-08-24T17:29:15Z")

</div>

**Hey everyone, I could use some help debugging my maze generator BP (`BP_MazeGenerator`).**

The setup:

- `MazeGrid` should mark paths as **1** and walls as **0**.
- `GenerateMaze` is supposed to carve paths by setting cells to **1**.
- `SpawnMazeMeshes` then spawns floors on path cells (1) and walls where it’s 0.

**The issue:**  
`MazeGrid` stays all zeros → walls spawn everywhere, no floors appear. The generator terminates immediately because `GetUnvisitedNeighbors` returns no neighbors from the start, so the stack empties right away.

I think the bug is either in the logic that updates `MazeGrid` or the neighbor-checking code. I added print statements, but still stuck. If anyone could take a look at my Blueprints, I’d appreciate it:

- EventGraph: [https://blueprintue.com/blueprint/\_djx3e\_6/](https://blueprintue.com/blueprint/_djx3e_6/)
- GetUnvisitedNeighbors: [GetUnvisitedNeighbors (function) posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/k-9j5cch/)
- InitializeMaze: [InitializeMaze (function) posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/uja3nb_h/)
- GetGridIndex: [GetGridIndex (function) posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/iqejgwmv/)
- GenerateMaze: [GenerateMaze (function) posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/wft86vmx/)
- SpawnMazeMeshes: [SpawnMazeMeshes (function) posted by anonymous | blueprintUE | PasteBin For Unreal Engine](https://blueprintue.com/blueprint/9kbqugv1/)

What is causing the issue and how can I fix it?

---

<div class="post-metadata">

**Author:** ![LegendGary](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LegendGary](https://forums.unrealengine.com/u/LegendGary)\
**Post date:** [August 25, 2025, 2:28pm UTC](https://forums.unrealengine.com/t/help-debugging-maze-generator-mazegrid-not-updating-walls-only-spawn/2650546/2 "2025-08-25T14:28:43Z")

</div>

1. Why you InitializeMaze again in GenerateMaze
2. Get Grid Index is always zero because in GenerateMaze you set CurrentX and CurrentY zero. Even Maze Width x 0 is 0.

Try to add delay. Loop take times

---

<div class="post-metadata">

**Author:** ![EyePatch](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@EyePatch](https://forums.unrealengine.com/u/EyePatch)\
**Post date:** [August 25, 2025, 3:27pm UTC](https://forums.unrealengine.com/t/help-debugging-maze-generator-mazegrid-not-updating-walls-only-spawn/2650546/3 "2025-08-25T15:27:59Z")

</div>

Thank you! I will take a look and let you know 🙂
