[=RuBa1987;185442]
So I have tried a few different things and I’m still having the same issue. It appears that i’m not getting a reference to the event manager but I don’t know why. This works just fine when I play in editor. Here are the errors:
When I check to see if the event manager is valid I get false back. But nothing else complains while running. I would expect to get errors on invalid types and stuff if the plugin itself wasn’t loaded.
Any thoughts?
[/]
Ok, so this looks like it’s a simple issue of order of operations. The problem was that the event bind for the event manager wasn’t getting set until after the
begin play
event as firing. I was binding the skeleton detected/lost events as well as the updated events on begin play in my pawn. This was causing it to try to call
UKinectFunctionLibrary::GetKinectEventManager
before
GetKinectManagerEvent.IsBound()
would return true because it hadn’t fired the constructor for
FKinectV2InputDevice
where the delegate gets bound.
The reason this worked in PIE mode is because that constructor is called on editor load so it’s already built and you’re good to go. When you load it up in standalone mode or a packaged version it causes the timing issue.
To get around this I put the event bindings in my tick method of the pawn and on each tick I just check to see if the event manager is valid. Once the manager is valid then I bind the events and set another bool to make sure I don’t do it more than once.