USharp icon indicating copy to clipboard operation
USharp copied to clipboard

How to get GetWorld() in C#?

Open mi1agency opened this issue 4 years ago • 1 comments

In C++ it's easy to #include "Engine/World.h" and get access to GetWorld() global to get the root game world, I can't find a way to do that in this project from C#.

mi1agency avatar Apr 09 '20 14:04 mi1agency

There's a property in one of the namespaces (I believe UnrealEngine.Runtime) called World. The World Property is equivalent to the C++ GetWorld() method. It's automatically accessible from all Actors and Actor Components. Although you might have to GetWorld another way if you aren't overriding an actor or actor component.

Tanner555 avatar Apr 09 '20 14:04 Tanner555