How do you do that?

I have an actor that has a function in it and I want that function to trigger when I am on a different level. Please help me I don’t know how to do it.

If you simply want it to trigger whenever you open a new level, putting it in the EventBeginPlay should work.

I don’t know how to explain this one exactly. In general, I have a menu at the start of the game, I want this menu to trigger a function that is in the actor on a different level.

I tried it that way, but nothing worked.

Can you describe what the actor does with the function? You can’t trigger functions on actors that aren’t loaded, and if the actor is in a level that isn’t loaded, you can’t trigger the function on that actor.

Is there any way for the function to work even if the actor is not loaded?

No, the actor not being loaded is basically the same as it not existing. You can’t tell something that doesn’t exist to do something.

What does the actor need to do?


Maybe there’s something I’m not clear on?

Can you explain your goal with the function. Why is it connected to a button? What does the Actor do when you press the button?

I need the boolem variable to turn true when I click a button. So I created a function for this purpose.

I’m going to run you through some persistency stuff real quick. So when you launch your game it opens a level. Only things loaded on that level can be loaded and communicated with. When you open a new level, everything including your player character and player controller are reset to default. The only things that aren’t reset are the GameState and the GameMode. What I would do if I were you is I would pass the GameState the bool variable you need the Actor to have then on BeginPlay inside the Actors blueprint, I would cast to the GameState and retrieve that variable.