Blueprint/Actor send value to LevelBP

I have an BP Actor that has a room with a collision box, when the player enters I want it to increase score in regular level BP so I can use this value for calculating room gen.

This code does return the string successfully but Idk how to have it add a value to a variable in LevelBP

I’m pretty sure you can talk to the level BP using an interface :slight_smile :slight_smile:

I’m not aware of any way to get access to the level BP. Even with interfaces, it would have to be the Level BP that sets it up and calls the interface.

If this is single player, I’d just put the level variable in your game instance. You can use GetGameInstance and cast it to your custom GameInstance Class.

You could make an object variable in the game instance, on begin play in the level blueprint cast to the game instance and set the object variable to a self reference, then use that variable from the game instance to send the interface calls to the level blueprint. I do not know of any simpler way to communicate with the level bp but if someone else does please share.

Like this

( this assumes you only have one level open )

2 Likes

I don’t know when this became possible, actually… :thinking:

I must say, I got the idea, or something similar, from @Everynone.

1 Like

There’s a subsystem that can fetch it, too, me thinks. However, having to do it sounds like an issue with the architecture - you should never need to pull anything out of the LB.

3 Likes