0 votes

This is the function in question:

func sleep(slowDownAmount, duration):
Engine.time_scale = slowDownAmount
yield(get_tree().create_timer(duration * slowDownAmount), "timeout")
Engine.time_scale = 1.0

It doesn't seem to execute in the same way on an m1 mac in comparison to when i run the identical project on windows. i've had discrepancies in the past with the two comps im testing on but those were primarily jittering issues and i ended up figuring they out were tied to frame rate and refresh rate (process / _physicsprocess). This function is being called on from a signal (on area entered)

The function works as intended on Windows, and it 'works' on the m1 mac, but the same values passed in yield very different results compared to windows (in terms of the sleep duration) and weirdly, anything below .4 seconds durations is completely unnoticeable on the m1 mac, as if the yield line isn't executing or something. any advice is greatly appreciated

Godot version 3.3.4 stable (occurred on 3.3.3 stable as well)
in Engine by (12 points)

I manually created a timer and printed the timeleft in _physicsprocess to see if something would avail itself. The timer was set to 0.021 seconds.

on windows, it printed 0.021, then jumped to 0.013361, then 0.012669, and so on, descending to zero pretty evenly from there and each print showed a decrement of around 1 thousandth.

on the m1 mac, it printed 0.021, then jumped all the way to 0.0043, and decremented every 1 thousandth of a second from then on. I tried this multiple times to see if there were any discrepancies in the logging from physics process, but it printed the same jumps for both every time.

so i don't know a fix, but at the very least, theres some more info. pretty reliably, and not just tied to timers created as 1-shots as part of a yield, on the m1 mac it seems to always just skip a chunk of time after the start, but it still recognizes that initial time.

There's probably a way better way of describing all this but it's pretty above my ability level lol. hope this adds more useful info, thanks again for any help

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.