How to get current world?

No, there is not a current, relevant, World. There can be multiple Worlds instanced simultaneously.

The World context is only relevant to objects contained within that World, so you have to have something in that World to be able to get at the pointer to that World.

Where are you calling this static function from? If something inside a world, use that as your context reference. Ultimately, some piece of code that is actually loaded somewhere in the World has to be in the chain somewhere.

2 Likes