Infinite Loop Detected

Hey!

Im pretty new to unreal engine 4, im trying to make a inventory system but i get this when im trying to start my game.

I would appriciate every help i could get! :slight_smile: THANKS

Could you show the place (or places) where this function is called?

Sadly this error message does not tell you where exactly something happens but only where the engine found it which may or may not be accurate :wink:

What do you mean? When i press the stuff it leads to the thing i screenshotted

Yes but the debugger just shows you the place of the code which is run in an infinite loop not actually the place where it’s caused since it could already prevent that while compiling in that case. It’s just an estimate and you’ll have to investigate.

The picture you showed is the function “ScaleToRatio”. Now to help you I’d need the places where you call this function since I’m ~99% sure it’s caused there and not inside of this function :wink:

Now we know for sure it’s not inside of the scale to ratio function itself.

Could you show some pictures of where you call that function? (Inside the code. Like the places where you created a node with the name of your function).

As i followed a tutorial i forgot where i put it and im very bad at blueprints, but it might be one of these.

So far it looks pretty legit. Could you show me the “Hotbar 2” script as well?

And in general: Stuff that doesn’t have an exec pin (the white line) can’t cause this issue. The exec line is the only interesting thing right now :wink:

i think its somewhere here then

When i remove that IsValid it works, but i need to have it.

Alright there we go.

You’ve created a recursive function (or in other words an infinite loop). Whenever HotBar 2 is called it does what it should do and at the end you call the function “HotBar 2” (itself) so it will just infinitely repeat it. Remove that and you’re fine.