Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Body Center is wrong when reset(x,y) and collideWorldBounds is enabled #5978

Closed
lukasharing opened this issue Jan 24, 2022 · 3 comments
Closed

Comments

@lukasharing
Copy link

lukasharing commented Jan 24, 2022

https://github.com/photonstorm/phaser/blob/d67c93646cbfe8ba5997954f8af29a8f3f9e8e91/src/physics/arcade/Body.js#L1393-L1395

this.checkWorldBounds() calculation should be called when reseting to avoid flickering

@lukasharing lukasharing changed the title Body Center Update is wrong Body Center Update is wrong when collideWorldBounds is set to True Jan 24, 2022
@lukasharing lukasharing changed the title Body Center Update is wrong when collideWorldBounds is set to True Body Center is wrong when reset from new position Jan 24, 2022
@lukasharing lukasharing changed the title Body Center is wrong when reset from new position Body Center is wrong whenreset from new position and collideWorldBounds is enabled Jan 24, 2022
@lukasharing lukasharing changed the title Body Center is wrong whenreset from new position and collideWorldBounds is enabled Body Center is wrong when reset(x,y) and collideWorldBounds is enabled Jan 24, 2022
@samme
Copy link
Contributor

samme commented Feb 3, 2022

Can you solve this with

body.reset(x, y);
body.checkWorldBounds();

? If so it doesn't really seem a problem with reset().

@lukasharing
Copy link
Author

I guess this should be made automatically when you reset, I know you can fix this by using checkWorldbounds, but doesn't seem correct if have to do it by hand. Because when it updates, world bounds are checked, so that frame is a flicker.

@photonstorm
Copy link
Collaborator

Thank you for submitting this issue. We have fixed this and the fix has been pushed to the master branch. It will be part of the next release. If you get time to build and test it for yourself we would appreciate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants