Hello I am a beginner I need help

i am making a 2d game where i am loading the location of the character but it is constantly looping without any loop i had put
this is my game load(Custom event) code


and here i am calling the load location function

here is the event graph of menu loading(Custom event)

and here is the event graph of game load function

and here is the output or loop where it just keep loading the load event

i had tried to add set event by timer but it is still looping when the timer finish

without the load location function it works perfectly fine

You have an OpenLevel node in your GameInstance’s MenuLoadGame event. If that event is called by LoadGame in your BP_MyGame_State, then that’s your infinite loop right there.

  1. Level loads.
  2. Begin Play event triggers in BP_MyGame_State
  3. Call LoadGame
  4. Call OpenLevel
  5. Goto step 1 since you’re now in a new level.

IOW, every time you call OpenLevel, BeginPlay is called. Every time BeginPlay is called, you open a level. Hence infinite loop.

thank you so much it worked

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.