In my current project, I make heavy use of events. I would signal an event in one object and then have a function that Awaits the signaled event inside another object. Before the latest update, Signal and Await would happen in the same frame. But now, in some cases, there are several seconds of delay between a Signal call and the Await being triggered. My code has not changed since the update, so I wonder if the new update introduced some changes to how events or work under the hood?
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Verse
Steps to Reproduce
Object A: Signal an Event
Object B: Await the Event
Expected Result
The Await happens in the same frame as the Signal
Observed Result
The Await happens several seconds after the Signal
I also think this is the case with standard epic devices as ive been making a baseball game and everything was working fine now there is a delay somehow on enable() a bouncer and even when i a pickup a chicken → register a input trigger if i dnt wait a split second the input trigger does nothing which is crazy ? this never was a issue before and now i do believe something has changed for sure.
How do i print time in the log ect so i can gather some more info
If you could advise on this i will run the same 2 functions with time prints
Adding this here in case others might run into a similar issue:
After looking into this a bit further, I was able to isolate the problem: the reason why the Await function got triggered with a delay was that in the body of that function, I called Spawn() and then Pickup() on a Damage Amplifier Device. Previously, this worked without any problems. After the latest update, it seems like a Sleep(0.0) is required in between the Spawn() and the Pickup() to prevent longer delays. I’m unsure why calling Spawn() and Pickup() in the same frame would cause these delays to happen, and also couldn’t find any mentions of this in the documentation. But inserting a one frame delay between Spawn() and Pickup() resolves the issue.
In my case, what fixed the issue was to insert a Sleep(0.0) between the function calls - this was not required before the update. But it somehow seems to be required now. I noticed similar issues with other devices as well, for example Teleporting an NPC Spawner before calling Spawn() on it also doesn’t seem to work without a Sleep(0.0) in between anymore. I’m unsure why this started happening with the latest update, but perhaps this is a workaround that works for you as well?
not sure if anything changed, but you can see in the docs that only immediate expressions will complete in the current simulation update, while an async expression has the possibility to not complete.
if I recall correctly a similar thing has happened to me with the wild animal taming after spawning it in the end of 2023, also just added the Sleep to fix it
Thanks for sharing this resource! I still don’t understand why the async function might fail or be delayed by calling Spawn() and Pickup() on a powerup device however, since neither of these functions suspend, transact or decide. They are immediate functions that should always complete in the current update.
That’s right, however the function that calls them could be, atleast according to your description (otherwise you would not even be able to call Sleep)
Unsure - Before the chicken that you hit in my game felt light but now it feels heavy or the bat has changed idk and when i register a player to an input trigger when the player is within range of the chicken if the player picks the chicken up straight away and doesnt wait then the input trigger doesnt work idk whats going on