Closed Kosmoon closed 1 year ago
Immovable just means it won't pick up velocity from the body it collides with, it doesn't mean it cannot be stopped. In this case, stopping is the correct thing for it to do. Passing right through the other body prior to 3.50 was clearly a bug.
Immovable just means it won't pick up velocity from the body it collides with, it doesn't mean it cannot be stopped. In this case, stopping is the correct thing for it to do. Passing right through the other body prior to 3.50 was clearly a bug.
Oh ok, so it was a fixed bug. Nonetheless, updating to 3.5 is breaking this wanted behavior in my game. Is there a way to achieve this in 3.5 ? An immovable object which can be collided by other objects but never stopped by them.
Use an overlap check instead of a collide one? If nothing should ever stop it, it doesn't need to collide with the other objects, just detect when it is over them.
Use an overlap check instead of a collide one? If nothing should ever stop it, it doesn't need to collide with the other objects, just detect when it is over them.
In my game the player should be able to interact with it (jumping on it, being pushed by it, so it needs to collide with it), but it should not stop it if being squished by it, instead it should go through the player and kill him. For the moment i'm using a trick that detects if the moving immovable sprite is stopped and i give it back its initial velocity + changing a little its position to compensate the frames where it was stuck. I'm not satisfied with this solution. This should maybe be a forum post instead
Closing this off as it was more a discussion than an issue. Feel free to re-open in the forum / Discord if still relevant.
Description
An immovable object with a velocity is stopped by a non immovable object when squishing it against another immovable object without velocity. expected behavior and seen behavior before 3.5: the immovable object with a velocity should keep its velocity and go through the non immovable object.
Example Test Code
paste the code bellow in: https://labs.phaser.io/edit.html?src=src/physics/arcade/sprite%20vs%20immovable.js&v=3.55.2