# How to identify hitches during playtime?

**URL:** <https://forums.unrealengine.com/t/how-to-identify-hitches-during-playtime/2390169>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [March 14, 2025, 7:12pm UTC](https://forums.unrealengine.com/t/how-to-identify-hitches-during-playtime/2390169 "2025-03-14T19:12:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Portine](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/portine/32/1182274_2.png) [@Portine](https://forums.unrealengine.com/u/Portine)\
**Post date:** [March 14, 2025, 7:12pm UTC](https://forums.unrealengine.com/t/how-to-identify-hitches-during-playtime/2390169/1 "2025-03-14T19:12:08Z")

</div>

Basically, I’ve an Island with various NPCs using MoveTo() loops and SetMaterial() on the NPCs themselves and in custom Progress Bars that indicate their HPs.

For additional info on the loops, a NPC loop calls about 6 'MoveTo’s and 2-3 'SetMaterial’s during it’s lifetime and a lot of NPCs can exist at the same time.

After some time, the game starts hitching and I can feel noticeable rollbacks, but I can’t identify where they come from. It doesn’t seem to be a particular issue with the Loops themselves (I’m correctly ending them when needed), from what I’ve debugged so far, but I can’t be sure with the 'MoveTo’s and 'SetMaterial’s.

I suspect of having a memory/network leak somewhere, so what am I missing? Is there a way to Dispose of Material Instances created during runtime that I’m not using?

I’m having to use SetMaterial everytime that I need to change a parameter in it, which I assume creates another instance each time and I can’t set a reference to the already created Instance, so what exactly is the best way to fix or identify the issue?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![GhostOfSatoshi](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ghostofsatoshi/32/1028933_2.png) [@GhostOfSatoshi](https://forums.unrealengine.com/u/GhostOfSatoshi)\
**Post date:** [March 14, 2025, 11:28pm UTC](https://forums.unrealengine.com/t/how-to-identify-hitches-during-playtime/2390169/2 "2025-03-14T23:28:53Z")

</div>

Hard to say without seeing the code, but I would start commenting out suspected trouble making code to try to narrow it down. I don’t know what purpose the loops are serving, but one of NASA’s best practices is to put a maximum number of iterations on loops to exit a loop if it goes infinite. Good luck.
