Hi, i’m new to unreal
can anybody help, that how should i connect the variable to switch ? i mean what target for that variable ?
Where is the widget created? Where is the object created? Are those 2 objects related in any way?
The easiest way would be for next_level to create a widget and pass the reference.
Consider describing what you’re trying to achieve.
Looks like you are trying to have the player go to a new level when they overlap a collision box actor. It increments the level they are on and then when they press the widget restart button you want to grab that integer from the box actor and load up the correct level. Unfortunately this setup is not ideal as you are having the box actor remember what level the player is on. The level variable should be in a player controller or player character, or better yet something like a game instance where it can easily be accessed and won’t change when you move from level to level. Regardless of where you place it, you need to get a reference to the object holding that level variable. This can be done through a cast node, an overlap/hit event, a direct reference through the level BP or selecting the actor within the world and providing the reference to the actor that needs it etc. Many, many ways to do this. I think it will help if you first get a basic idea of the blueprint system and things like how to create references, casting, widgets, variables etc. This series I made should answer a lot of the questions you seem to have about setting up this system of yours.