Separates two overlapping bodies on the Y-axis (vertically).
Separation involves moving two overlapping bodies so they don't overlap anymore and adjusting their velocities based on their mass. This is a core part of collision detection.
The bodies won't be separated if there is no vertical overlap between them, if they are static, or if either one uses custom logic for its separation.
name | type | description |
---|---|---|
body1 | Phaser.Physics.Arcade.Body |
The first Body to separate. |
body2 | Phaser.Physics.Arcade.Body |
The second Body to separate. |
overlapOnly | boolean |
If |
bias | number |
A value to add to the delta value during overlap checking. Used to prevent sprite tunneling. |
true
if the two bodies overlap vertically, otherwise false
.