s4m_ur4i

Disable mass / weight to prevent body "fall through" other bodies

Recommended Posts

Hi There,

I use Arcade physics on Phaser3. And I got multiple moveable bodies which stick on top of each other.
For two bodies this works, the third does sink a bit into the second and the forth makes the whole stack collapse and fall through the bodies. (example image attached)
(edit) Note: Bodies are not falling through static sprites, the described behavior does only apply to dynamic bodies.
I would prefer a "not checking" for weight, - setting velocity Y to 0 on collision does inflict many more problems. So this won't solve the issue.

I set the OverlapBias on the Arcade physics to 20 (code below) to prevent bodies with high gravity falling through static sprites.
The Y gravity is set to 2000, decreasing this amount does not solve the issue and the gravity amount is needed.
 

arcade: {
  gravity: {x: 0, y: 2000},
  debug: true,
  overlapBias: 20
}

What I came around was thinking to set the weight or mass so that the sprites don't "sink" into each others body.
Even tho if a body is falling on onto two bodies which are on top of each other, they complete break and fall through.
Does anyone have an idea how to fix this? 

example.jpg

Edited by SamTheMighty
further explanation for better understanding

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.