Tuesday, April 16, 2024
HomeSample Page

Sample Page Title


Hello Cocos Community, :grinning:

i rly hope you’ll be able to assist me out, trigger it makes my mind disintegrate. :exploding_head:

I’m utilizing the cocos creator model 2.4.10.

I’ve a Problem 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.

Here is how i attempted it:

cc.recreation.setFrameCharge(60);
let physics_manager = cc.director.getPhysicsSupervisor()
physics_manager.FIXED_TIME_STEP = 1/60;

On excessive frames it applies gravity, power 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 power for leap:

this.Rigid_Body = this.node.getComponent(cc.RigidBody);
this.Rigid_Body.applyForceToCenter( cc.v2(0,70000) , true);

But not solely the leap, the stroll power will get utilized totally different too even after I use a scheduler as an alternative of the Update Method.

The telephones override it nonetheless it’s configured.
On the Oneplus7tpro(additionally a 90hz Phone) it really works simply tremendous.
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 the right way to implement a variable refresh charge to the Physics Engine trigger so far as i do know its replace is certain to the Device’s Frame charge.

Is there any answer to this, or one other solution to make the Physics replace to a set interval?
I’m additionally open to different approaches.I simply wanna get this mounted… :neutral_face:

Thanks prematurely!
Patrick

Have you tried setting enabledAccumulator to true?

Yes, it’s essential to first get the refresh charge of the system after which set the Physics Engine.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments