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

Friction property does not work with .setDirectionControl() method #6792

Open
sLokhin opened this issue Apr 11, 2024 · 1 comment
Open

Friction property does not work with .setDirectionControl() method #6792

sLokhin opened this issue Apr 11, 2024 · 1 comment

Comments

@sLokhin
Copy link

sLokhin commented Apr 11, 2024

Version

  • Phaser Version: 3.80.1

Description

Does the friction property of Phaser.Physics.Arcade.Body works in conjunction with the .setDirectControl() method?
Here is a link to a good use case for platforms from the documentation page. If I set the friction property through .setFriction(1, 1) for each platform, I expect that the player being on the platform will move along with it. But it slips through. I've already implemented this mechanics with platforms on Phaser 3.55, calculating the velocity of the platform depending on the coordinates manually. It still works on the phaser 3.8, but I would like to use .setDirectControl() method, it would help remove a lot of unnecessary calculations.

Example Test Code

Examples are available from the documentation page
PlatformsExample

additionally set

platform1.setFriction(1, 1);
platform2.setFriction(1, 1);
platform3.setFriction(1, 1);
@samme
Copy link
Contributor

samme commented Apr 22, 2024

Looks like a direct-control platform's body.prev is identical to its body.position during the collision, so the friction vector is (0, 0).

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

No branches or pull requests

2 participants