Is velocity frame rate independent?

is velocity framerate independent when outside of fixedupdate,

i have an ontriggerenter event that causes velocity to a rigidbody, now as the ontrigger is not in fixedupdate it means the added velocity is also not in fixedupdate so will it run at different speeds on various machines, if it is a problem how can i have an ontrigger in update so i can use time.deltatime on the velocity.

thanks

physics is a simulation that updates on a fixed time step. It is intended to not be frame dependent (though extreme slow down, with frame rate dropping, will impact the simulation… but the entire system is slowing down, so of course it will).

The velocity is therefore what velocity in simulated time.

‘OnTrigger’ isn’t in FixedUpdate… but it IS called during physics calculation. As you can see here:

So it too is not framerate dependent.

Note, this does not mean that physics is deterministic…

Well, this question can’t be answered. Velocity is neither frame dependant or independent. It’s depends on how it used.
The physics engine uses it in a frame independent way. If you used this variable somehow, you need to use it in combination with Time.deltaTime if you expect a frame independent behaviour.

BTW, what are you doing exactly with velocity?

Edit:
Oh, you are updating velocity. Then you have to take care that this update is frame independent. That’s mean you are applying an acceleration. Therefore, you need to apply this acceleration in a way that it make sens physically.

So, how are updating the velocity exactly?

this is the code that applies the velocity:

rb.velocity=newVector3(0,bounceheight,0);

bounceheight is set as a float in the inspector,

the line above is in the ontrigger enter method/function so i cant use time.deltatime, it seems a bit strange that if you use trigger to apply a velocity there is no way of using time.deltatime which is why i need to know if it will run frame rate independent or i will have to find another solution as this is for mobile devices and needs to run at same speed on all devices., is there anyway to apply velocity using time.deltatime using trigger.

cheers

That’s ok. You set the velocity instantaneously at a specific point in time. There should be no frame rate dependency here.

Just a remark. The name “bounceheight” is misleading, should be something like “speed” or “verticalSpeed”.

lol yeah so true , now looking back i dont know why i called it that as it is the speed and not height anyway, must have had coders brainstorm when i named it.

thanks for the help guys, much appreciated…