-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
Arcade Physics allow sprites to push eachother through otherwise impassable objects #1513
Comments
Nice image story - it makes the problem clear. Unfortunately, I don't think is trivially resolvable with the current Arcade physics .. The collisions of the entire system need to be considered to prevent moved objects (that are not themselves marked as immovable) from pushing through other objects (immovable or not). P2 is an implementation that can understand the system-wide constraints - is there a particular aspect of P2 that is undesirable in this case? (It might be able to work around such if there is.) In general I would only use Arcade in a system where a particular initiator always reacts (eg. target is immovable), there is a custom handler, or touch = event & pass-through or pick-up; there are many games that fit in this category, but not everything. |
My problem with using P2 is that I lose a lot of the nice stuff I get with arcade. For example, it seems like an absolute pain to implement "body.touching.down" with P2. |
@hydrabolt I wonder if it may simply be simplest for the current case to make the "brick" immovable so that the Arcade physics will not move it in a collision. Any interaction (eg. pushing) with the brick would then have to be controlled manually, of course. It should be able to use the left/right touching in that case. |
Thanks, but I face 2 problems with this:
|
What I'd suggest is using a custom separation handler for the brick. Then you can re-position the character sprite accordingly and prevent the brick from tunnelling through the floor. The principal would be identical to the tutorial I wrote for cloud platforms in Phaser Coding Tips 4 |
Hi!
I'm using Arcade Physics, and whenever 2 of my sprites collide, one pushes the other down into the ground until it falls off. I don't want to use P2 Physics just to fix this bug!
The text was updated successfully, but these errors were encountered: