So i was making a rocket league sorta game ive already posted about quite a few times because of a lot of issues and my main issue right now is the car rotates much faster on higher fps. To get around this i tried to use a repeat every second event to run all my events within, and because this is based on timers i expected this to run every 0.02 seconds regardless of framerate. Unfortunately this didnt actually change anything and the car still rotates much faster.
This idk how it runs but from your description seems it goes by framerate
Where i think timers are actually time based and not fps based
For sure Wait action is time based
SO your options
Run timer and if timer is above some value you run your event and reset timer
Or you use wait action if timers are FPS based but i believe they are not
This is exactly what im doing and its not working, it does no result maybe because its only checking if the timer is above that value every frame and since it is very small value its still running events every frame instead?
As far as i know Wait action does run on real time
So you can try that
Like you make boolean var false by default
YOu check in condition if boolean is false with trigger once
And use wait action for however long you want
And switch boolean to true
When boolean is true you run your events and set boolean back to false
i tried to implement like this but it does not work. is there solution using timeDelta() function? ive seen this in a couple places but i dont really know how to implement. i can show my code if you need…
it does, its intended to replace the normal functionality of checking actions frame by frame so that it runs actions independently of framerate
it is but theres apparently ways to use it in my use case but they dont work well for me
ill try this now but again i think this will just run it frame by frame because it can only check frame by frame so sadly i dont know what to do, plus its problem with implementing it so everything happens at the same rate regardless of fps (the car should turn and jump and boost independently how the framerate of the game)
it is fps based but measures time since last frame so somehow by multiplying the rotation speed by timedelta it rotates slower if there has been less time since last frame, which makes sense because if i am at a higher fps there will be less time elapsed between frames, for example the time between frames running at 144 fps will be less that the time between frames on a game running 30 fps
Just to clear up some context about the original ask/question: Timers are based on timedelta. Timers also based on the current time scale of your scene, which will slow down if your game drops below your minimum framerate.
e.g. If your minimum framerate is 60, and your player is only able to get 55 fps, your game will actually bump down to 30 FPS (as Chromium is VSync enabled), and your scene scale will slow down since it’s below your minimum framerate.
Timers will not go faster than timedelta at higher framerates, in that 1 second will always be 1 second no matter how many more FPS you have (above the minimum framerate/timescale changes)
All of this said, timer conditions can only be checked every frame. If you have someone getting 200 fps and someone getting 60 fps, and you have a timer condition set for 2.5 seconds, the 200 fps person could run that event before the 60fps person, if 1 frame is at 2.499 seconds, (since 60fps is 0.016 seconds per frame, the timer wouldn’t activate until 2.514 seconds. The 200 fps is 0.005 seconds per frame, so it’d activate at 2.504)
Don’t use timers to limit the number of times events are run. Instead use DeltaTime() as explained in the wiki and let us know if you have further questions.