Hi there Cocos Group,
i rly hope you possibly can assist me out, trigger it makes my mind crumble.
I’m utilizing the cocos creator model 2.4.10.
I’ve a Drawback on excessive refreshrate telephones.
On some it really works, on some not.
I can’t set the framerate neither the FIXED_TIME_STEP from PhysicsManger.
Right here is how i attempted it:
cc.sport.setFrameRate(60);
let physics_manager = cc.director.getPhysicsManager()
physics_manager.FIXED_TIME_STEP = 1/60;
On excessive frames it applies gravity, drive and many others… totally different than on 60 fps.
The leap for instance is extraordinarily low powered on excessive frames.
right here is how i apply the drive for leap:
this.Rigid_Body = this.node.getComponent(cc.RigidBody);
this.Rigid_Body.applyForceToCenter( cc.v2(0,70000) , true);
However not solely the leap, the stroll drive will get utilized totally different too even once I use a scheduler as an alternative of the Replace Methodology.
The telephones override it nevertheless it’s configured.
On the Oneplus7tpro(additionally a 90hz Telephone) it really works simply positive.
Now I switched to a Samsung Fold 4 and there it overrides it to 120hz and on another telephones too.
I do not know on methods to implement a variable refresh price to the Physics Engine trigger so far as i do know its replace is certain to the Machine’s Body price.
Is there any answer to this, or one other strategy to make the Physics replace to a hard and fast interval?
I’m additionally open to different approaches.I simply wanna get this mounted…
Thanks upfront!
Patrick
Have you ever tried setting enabledAccumulator to true?
1 Like
Sure, it’s essential to first get the refresh price of the machine after which set the Physics Engine.
Sure that’s it! Thanks!