Closed sLokhin closed 2 months ago
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).
Hk @sLokhin. Friction won't work when using Tweens in this case.
Here are some possible workarounds: https://phaser.discourse.group/t/platformer-moving-platforms-body-follow-path-vs-friction/6825
@samme previously mentioned a solution here: https://phaser.discourse.group/t/riding-moving-platforms/7330
Also a tutorial series by cedarcantab here: https://phaser.discourse.group/t/phaser-coding-tips-3-ride-on-platforms-revisited/11520 https://cedarcantab.wixsite.com/website-1/post/phaser-coding-tips-3-revisited-part-1-ride-on-platforms https://cedarcantab.wixsite.com/website-1/post/phaser-coding-tips-3-revisited-part-2-ride-on-vertical-moving-platforms https://cedarcantab.wixsite.com/website-1/post/phaser-coding-tips-3-revisited-part-3-ride-on-elliptical-platforms https://cedarcantab.wixsite.com/website-1/post/phaser-coding-tips-4-cloud-platforms-revisited
Version
Description
Does the
friction
property ofPhaser.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 thefriction
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 Phaser3.55
, calculating the velocity of the platform depending on the coordinates manually. It still works on the phaser3.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