I’m developing a TCP client to connect to a 3th party server. I’m using the networking classes from UE4 (FSocket) and for receiving the packets from the server I’m running a background thread initialized by a non-game class (I mean, the class doesnt inherit from UObject).
When a packet arrives I need to get a reference to the actual UWorld in order to get the actual playing level, set animations, spawn actors, etc.
As far as I could find here in the forums, the suited method for that would be GEngine::GetWorld(). GEngine should be a static class that lives from the start of the first level to the end of the game and its GetWorld method should return the actual playing UWorld. Could anyone confirm that?
Also, when calling
from that recv thread I always get a nullptr. Does anyone have any idea why is that happening?
I posted this question in the question hub but only got 1 view aside from mines (3 total). I’m trying to reply the question here hoping that the community is more active here. UE4 have such a steep learning curve, with a poor documentation for deep programming, if the community is really that scarce I guess it’s not worth to stick with the engine to make my project. Even with a strong c++ background I got stuck every now and then due to poor documentation, it’s frustrating to see that the docs are just the code-comments as a html page. (link to the other post here: https://answers.unrealengine.com/questions/602420/how-to-get-uworld-from-a-background-thread.html ).