Casting to level blueprint

How would I cast to my level blueprint? If anyone knows how to do this, can you show me an example blueprint. Thanks!

Getting a reference to the levelBP is not possible in BP and rather inconvenient in C++.

You are not meant to have a reference to the level BP. The level BP can extract data from existing classes when necessary, though if it’s not scripting for interactions in one specific level (aka activating a cutscene) you might want to consider using some of the other available classes, such as the GameInstance, GameState or PlayerState instead.

Also, in order to be able to cast to the level blueprint, you would already need a reference to the level blueprint. Meaning you would need to already have access to something you can not have access to.

I am now almost certain a cast does not do what you expect it to, which is not at all bad! We were all learning at some point. But I would highly recommend to read up on how exactly inheritance and casting works :slight_smile:

Cheers and good luck with your project!