Will do, thanks for this. Ive heard about the constant too, wayyyy less errors to come out of it
what does that means? is it working well?
good, note that in this case is up to you to choose the behavior you want.
i think a finterp (“with easing” ) is more natural.
And just to make it clear again, the “Accelerate” Function is being called on the “suspension casts” function which happens every tick
Also instead of using world delta seconds, I’ve promoted my tick’s delta seconds to a float variable and have been using that for the delta time
also this code makes no sense. i think you need to try to understand how finterp works. because now, and i say it kindly, you seem to be trying things out with closed eyes.
that’s ok but not necessary. there’s a pure global function “getworlddeltaseconds”.
thogh, personally i like the idea of saving the dt in a variable, that way you can control it separately from the rest of the game and keep it consistent.
the function seems correct. hmmm then maybe i’m missing something with the addforce.
(btw it doesnt matter if teh tick delta is at the bottom, since it’s a multiplication.
all good, my point is, youll benefit from getting the basics right.
No. The car goes normal car speeds at 120 but when setting fps down to 30 it will go 4X
Yes yes, im decently new to UE5 blueprints so a lot of this stuff, especially for vehicle handling is quite new
And ill send it again just in case this helps, this is the suspension of the vehicle. It was also acting up with the fps but I got it work consistent throughout. I also enabled “Substepping” in project settings and set the default delta max to 0.016667
Hmm maybe ive missed something with the add force.try this:
Put the Accell function aside for now.
Dont call it.
Create a new function AccellTest,
And make it super simple. Call AddForce, and calculate thef force as this
ForwardVector* Speed * Dt
And call it per tick.
That will add a constant frame independent force every tick
Then try with both fps
If it differs, well, tthen theres an issue with themphysics engine andmhow were doing this
Alright, will try
Yups that looks awesome
And then put it inside “suspension trace” function’s end. Or outside the function on the tick itself?
Either way it seems to not be moving anymore now. The way the other one functioned was through the wheel comps. It would base the force applied on where the wheel comp was. Front left, back right etc etc… (Since the car isn’t on the ground and is being pushed up by line traces)
Alright so I multiplied this by mass and is now moving forward HOWEVER. When changing the fps it flies away yet again
If your suspension trace is fine it would be the name. But im clad you tested ddrectry in tick to be sure.
Ok, if i understand correctly, then you managed to isolate the issue to how the add force works.
Unfortunately im not sure what the exact issue it is there.
Would a timer be able to make this whole tick problem go away and just have a timer on begin play that runs an event every so often? I tried this before but would this work or is it a bit more complicated
Everything I’ve shown is what the movement is derived from. First in the order on the tick if will send a trace to the ground to see if we’re in air or not. if not, it moves onto the acceleration. That’s it currently
Ok so maybe we dont need the delta time here.
Can you try removing the deltatime for the accelltest and test again.
““
AddForce accounts for delta time and should be used for applying force over more than one frame, AddImpulse does not account for delta time and should be used for single ‘pushes’, like from an explosion or being thrown by a player. The reason is that if you use AddForce for throwing or an explosion, how far the object moves depends on the framerate at the exact frame the force was applied, rather than being independent of framerate like AddImpulse is."“