Get reference to the current UWorld

I’m trying to get a reference in my level blueprint.

In C++ I simply call GetWorld() on any actor or object. However in Blueprint I see no way of acquiring a reference to the world. Even if I have a reference to an actor, actor doesn’t have a GetWorld function.

My current workaround is to have an actor and pass the actor into a Blueprint Library function instead of the world itself. Then the function calls GetWorld on the passed in actor. This is a slight hack for now.

Is there just a good reason to not ever have references to the world in blueprint for some kind of encapsulation reasons?

1 Like