Hi,
I’m dealing with strange camera bug because setVelocity is returning decimal number,
can I use this function and get non decimal velocity number?
I just need to apply setVelocity to sprite and get his final location X,Y to be always non decimal number
Is it possible?
samme
2
Try { roundPixels: true }
in your game config and see if it solves your problem.
Actually this helps on desktop…
But not on mobiles and devices where pixel ratio is 3
Hmm… Have you tried flooring or rounding each component of your velocity before setting it? For example:
sprite.body.setVelocity(
Math.round(x),
Math.round(y)
);
x and y in this case would be the x and y velocity you want to set. Hope this helps.