I am using 4.15.1. I call DemoNetDriver->GotoTimeInSeconds with the specified time and the delegate to trigger when done. I noticed, that the delegate is not triggered, when it worked(the demo goes to that position and plays fine from there on) and will only trigger when it fails.
By looking at the source for DemoNetDriver i noticed, the only position where UDemoNetDriver::NotifyGotoTimeFinished(true)
is called, is in
UDemoNetDriver::FinalizeFastForward
However from the little peek i took into the source, FastForward is never active during GoToTimeInSeconds, and therefore, at no time, the delegate is triggered.
Okay maybe the deadend is on me:
I wanted to call this function from BP so i added a static function to a static functionlibrary. Since C++ BlueprintCallable functions can only handle DynamicDelegates but the delegate for this function is not dynamic, i declared a dynamicdelegate as parameter and wrap a call to it in a lambda which is bind to the delegate given to the function of the UDemoNetDriver.
Oh i am sorry. I am still experiencing this issue. Sadly the ShooterDemo does not make use of this delegate, so after looking through my code i could not see a direct problem.
Would you mind providing me with your logs? I’ve discussed this with one of my colleagues, and it appears that you should be seeing some result in your log file from the fast forward.
Thanks, that’s all I needed to check for, so no need to provide the logs. Go ahead and spend some time investigating it and let me know what you find.
If you come across any information that I can use to reproduce the issue on my end, and you believe that it is a bug, then feel free to let me know by leaving a comment to reopen the thread.
Sure. But i am not sure i can share anything public right now. Should i send it to the techsupport with a link to this Answerhub here?
BTW:
I do see entries like:
“Fast forward took 0.07 seconds”
“Fast forward took -0.26 seconds”
So it is definetly there. And therefore NotifyGotoTimeFinished(true); is called. So it must be on my end. I’ll investigate, it is me then screwing up adding the delegate for the Blueprint or something.
EDIT: OH OFCOURSE i create a local delegate in the function which is used for GoToTimeInSeconds, but at the time the callback is called the original delegate went out of scope!
Okay then the real question is: I have a C++ STaticFunctionLibrary, exposed to BluePrint. One static function is for exposing the “GoToTimeInSeconds”. My Idea was, that this function (exposed to BP) has an input-parameter of type FOnGotoTimeDelegate. But since that one is not a dynamic delegate, it seems to be unusable for Blueprint. So my idea was to have the input parameter be of a dynamic-delegate type and call this dynamic delegate in a lambda bound to a local FOnGotoTimeDelegate(which runs out of scope). So how can i expose this to BP properly, then?
i edited my comment the moment you wrote the answer
The edit describes what i want to archieve. In short:
Expose GoToTimeInSeconds as a static function in a StaticFunctionLibrary for BP with a Delegate-Parameter to get notified, which i messed up(info in the other comment).
Yeah, I just saw it after posting the answer. As a result of this not being a bug, I moved it into the C++ Programming question. We can’t guarantee support for development questions, but I can move it to a section where other users can comment and help you out with your issue.