Closed Skino1337 closed 11 months ago
The timer doesn't execute the function from another thread but still from the same game thread. As for your issue with the sound wave not being played back when executed from the timer, it might be due to various reasons. For example, your object might be garbage collected during the import, and that's why the OnResultNative
never gets broadcasted, not sure about your particular context.
Accidentally closed the issue. So, if you have any other context, please let me know.
Found solution, just this function in UE5 broken: they return nullptr if WorldContextObject is World object.
UWorld* World = GEngine->GetCurrentPlayWorld(nullptr);
Also return null into ur delegete func.
The OnResultNative
delegate is executed in the game thread, so there should be no difference between executing your game logic-specific code and the code after OnResultNative
in terms of their behavior, as all the delegates in the plugin broadcast the state externally to the game thread. So, I believe the issue is simply that the world of your UGothicUE5Dialog
is invalid by the time you tried to obtain it. If you want, you could also directly pass the WorldContextObject
in your UFUNCTION
, which is especially relevant if you call it from a Blueprint class, as it almost always has a valid world in the majority of contexts:
UFUNCTION(BlueprintCallable, meta = (WorldContext = "WorldContextObject"))
void Play(UObject* WorldContextObject);
Please feel free to reopen this issue if it's still relevant.
My play func:
If i directly call "play" function, sound play, but if i use call from timer, sounds just not play:
My other code: Audio imported successfuly, but audio from "CreateSound2D" is not valid.