Component system order

I can’t calculate velocity on current frame in custom script, because sometimes framerate changed and entity move on some distance more then i calculate.

Playcanvas has specific order of calling component system update:
first it calculate dt;
for this dt called update for rigidbody component system,
then other commpon call update with this dt
then only called script update with dt

How i can calculate velocity for current frame to stop entity in specific place, with const dt your order can work, but if dt is diffrent on each frame my entity move far from target position;

Using teleport after miss position in my case not acepteble, so i think script system update must called early then rigidbody system update;

or subscirbe on aplication update event here:

, which is called after all component system update.

In legacy script there was fixedUpdate which is called before all components system update;

for now i change order in this way:

var physicsComponentSystem =;;, physicsComponentSystem);

is it correct way?