# how to debug array corrupting

**URL:** <https://forums.unrealengine.com/t/how-to-debug-array-corrupting/2216734>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, question\
**Created:** [December 13, 2024, 6:54am UTC](https://forums.unrealengine.com/t/how-to-debug-array-corrupting/2216734 "2024-12-13T06:54:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![barbrian0723](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@barbrian0723](https://forums.unrealengine.com/u/barbrian0723)\
**Post date:** [December 13, 2024, 6:54am UTC](https://forums.unrealengine.com/t/how-to-debug-array-corrupting/2216734/1 "2024-12-13T06:54:46Z")

</div>

hi

struggling with an array that corrupts at a point  
at some point an array corrupts and loses all its values  
beforehand it reads fine : i have placed a breakpoint for debugging because an array value turns bad, and i want to see why and when  
as said, initially the array reads fine and has valid values (its an array of structures)  
then, at some point the entire array corrupts and all values in the array become garbage, not just a single entry  
i have search all references of the array across all blueprints to see where the array potentially is changed but i dont see anything out of the ordinary

is there another way to debug this case

thanks

---

<div class="post-metadata">

**Author:** ![barbrian0723](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@barbrian0723](https://forums.unrealengine.com/u/barbrian0723)\
**Post date:** [December 13, 2024, 10:07am UTC](https://forums.unrealengine.com/t/how-to-debug-array-corrupting/2216734/2 "2024-12-13T10:07:57Z")

</div>

tried to use a watch point on the variable but in the end had to take the code apart to locate the point of departure

---

<div class="post-metadata">

**Author:** ![BRGDemianLopez](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/brgdemianlopez/32/1052421_2.png) [@BRGDemianLopez](https://forums.unrealengine.com/u/BRGDemianLopez)\
**Post date:** [December 13, 2024, 2:46pm UTC](https://forums.unrealengine.com/t/how-to-debug-array-corrupting/2216734/3 "2024-12-13T14:46:56Z")

</div>

Hey @barbrian0723 !.

If code is written on C++ the correct way to debug it is by using breakpoints to follow the execution flow. Here are some suggestions:

- Try to find the point where data gets corrupted and then use a breakpoint to see what is happening.
- Sometimes you can use a data breakpoint wich pauses the execution when a variable changes his value, but sometimes its not usefull if your value is changing frequently.

Feel free to share the code that is causing problems so i can help you with the bug.
