You can move your camera update logic the postUpdate() callback, that will resolve the lagging:
Camera.prototype.postUpdate = function(dt) {
if (!this.target) return;
// get the position of the target entity
var pos = this.target.getPosition();
// calculate the desired position for this entity
pos.x += 0.5 * this.distance;
pos.y += 0.5 * this.distance;
pos.z += 0.5 * this.distance;
// smoothly interpolate towards the target position
this.vec.lerp(this.vec, pos, 0.5);
// set the position for this entity
this.entity.setPosition(this.vec);
//this.entity.setPosition(pos);
};
Ah right, then the issue isn’t with your code, and given it’s a super simple project it’s not PlayCanvas related at all.
For some reason either the device is super slow or the browser isn’t utilizing all the available hardware resources. Not sure why, maybe do you have multiple launch windows active at the same time?
When I simulate mobile device using Firefox it is more smooth but it is not that smooth as in Chrome (60 FPS), and I found out that it is more smooth when play window is smaller.
I also tried your main project in at least 4 different browser(Opera GX, MC Edge, Firefox Dev, Safari), where the ball was super laggy as well, its not the performance. And as i can see everything around is smooth, its just the ball
Odd thing is that when i scale resolution to lower the lags are disappearing
When i tried “test project” where ball just falls on the ground its smooth in every browers
My specs:
Already tried to set layers.acceleration.force-enabled to true, and block sompositor, I have around 30 FPS now, but ball is still lagging behind camera.