How to cast actor blueprint in level blueprint?

i want to make that, if all bottles are destroy then level will complete in given time with bottle count variable. so how to cast actor blueprint in level blueprint

Bottle actor blueprint →

level blueprint →

Casting is not a method of communication - it’s testing whether an object is of specific type and then treating it like so.

If you placed the bottles in the level, there’s no need to cast at all. Just drag & drop bottle actors’ references into the Level Blueprint from the World Outliner. Have the LB count and destroy the bottles.

As the above answer states, you just need references to your bottle actors in the level BP, that is one thing it is quite handy for. If you need to communicate with the level BP which I think is what you might be asking for by asking how to “cast to” you are looking for an event dispatcher. That will allow you to fire off events in the level BP when things happen in world actors like your bottles. If you need help with casting, references or event dispatchers check out videos #1, 25 and 26.

This is what you are telling me ?

for the purpose you are trying to achieve casting the actor blueprint in level is not optimal, instead you could use a game instance to set the number of bottles you have destroyed and check in the level blueprint if the number is equal to the number of bottles in level.

you can learn to use game instances from here:UE4 - Tutorial - Game Instances

I did it but their is a problem ,when ever i am going to next level or restart current level the game instance variable stored previous value. so, how to reset it when i quit or complete current level or restart my level.
Level blueprint →

Actor blueprint →

Yes, except you don’t need the cast node, the level blueprint creates a direct reference. And you don’t need to use the game instance if you want the variable to reset each level. The level blueprint is fine for that. But you may want to consider putting this script into an actor you can place in each level, this way you don’t have to repeat the code in each level blueprint.

Like this?

Exactly. The cast was unnecessary.

I guess that you need the instance variable for one map and as soon as the level is complete the bottle count should be set to zero, if so then you can reset the bottlecount as soon as your level is completed(when all 12 bottles are destroyed ) in this way in your new level you will have a fresh bottle count