The following behavior change is affecting versions from 3.10 (tested with each minor from 3.0 to 3.23):
Made a quick video of it.
I call it a bug given the following rules I would consider “de facto” about platforms moving horizontally:
as a player, my body should be transported by the moving platforms that I ride, provided that:
these platforms move by means of velocity (not by replacing their position every step)
these must have frictionX set to a positive value (1 is most likely)
as a player standing on that moving platform, if my body hits a wall while being “transported”, I expect to be blocked by the wall - and not ride the platform through that wall.
let the moving platform bring the top lemming against the wall.
observe the lemming is not stopped by the wall
retry this time using the right arrow on your keyboard
the wall stop both lemmings
Possible cause: is friction transferring position differences to the “riding” bodies in 3.10+ instead of adding its velocity to that of the riding body like in 3.9 and below?
Hi Samme,
Thanks for your answer; I’ll experiment with the collision callback, but I still think it’s a regression/breaking change.
I’d love to know what’s the take of @rich on this behavior though. It was working the “way I needed it to be” until 3.9 included. Maybe the behavior change between 3.9 and 3.10+ was intended, and not a bug like I’m tempted to call it. I simply wish to be on the safe side and not create a workaround for bug that was waiting to be detected.
N.B. I’ve ported my game to Phaser from a whacky cocos/chipmunk stack because I had to hack and patch those libs way too often… I haven’t had to write a single “hack” with Phaser in spite of being new to it. I started 1 month ago… such a clean lib is what got me puzzled when I saw the friction/riding/collision behaviour, that’s what made me dig in earlier versions.
The callback itself simply checks a custom property such as “should this platform apply its velocity onto the riding body? or had it been given friction knowing no walls will be traversed?”