Infinite Loop on Script

Hello everyone,

My name is Jose Manuel and I am trying to make a “game” to people who need to do some exercise of rehabilitation.

The problem reside on blueprint where we create the floor and the script. Actually we got Main Menu and Pause Menu but when we click Start on Main Menu an error spam the window:

And here you got the script:

THANK YOU SO MUCH

The 3 mentioned functions could be helpful, SpawnPoints, SpawnBlocker and SpawnCoins

I can’t spot any mistakes in this BP. Note that for Unreal an infinite Loop just means that a Node has been triggered very frequently (e.g. 100.000 times in a second). Disable everything but one function. If this works, enable a next one and see if that works to find out where exactly the error happens. Are there any other Actors related to this BP? Check them.

the problem is that after i create menu and pause menu, everything works good but before i implement it the error has come and the game goes correctly if i press “Simulate” in BP_FloorTile ; while i stayed in MainMenu level, it doesn´t work

Ups, sorry about that

THANKS AGAIN!

Have you tried moving this logic to “Begin Play” instead of the Constructor? I find it’s generally less dangerous to have init logic run at Begin Play when everything is guaranteed to be loaded in the world than in the Constructor. Also keep in mind that the constructor will run when you place an object in the world and interact with it in the Editor viewport, but Begin Play will only run when you are “Playing” the game.

If i try to move the constructor script to Even Begin play I think that i would need to create the other function on the same “way” because it couldn’t play well if I dont create it

what specifically requires you to have your functions run in the constructor script?

Ups, sorry I forget this post.
Mates I solved this problem moving the construction script to event begin play. Thanks for all your help

Ups, sorry I forget this post.
Mates I solved this problem moving the construction script to event begin play. Thanks for all your help

no worries, glad you resolved it! you should mark my answer as resolved so others can hopefully find the same recommendation useful :slight_smile: