-
Hi |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There are several ways of doing this. Method 1: You can get the normal of the collision between two shapes. You register the OnCollision event on a body, and in the event method you can use the Manifold property to get the normal. If the normal is 1 (or -1) on the Y axis, then the collision is on the ground. See lines 106 and 215 in this example: https://gist.github.com/Genbox/9b3d2232b6bc22b6c8815487d086c769 Method 2: You can register OnCollision like Method 1 and check if the body in the collision is the ground body. Example here: https://gist.github.com/Genbox/9737d1155efcdd00c9858cf7a492323e |
Beta Was this translation helpful? Give feedback.
There are several ways of doing this.
Method 1: You can get the normal of the collision between two shapes. You register the OnCollision event on a body, and in the event method you can use the Manifold property to get the normal. If the normal is 1 (or -1) on the Y axis, then the collision is on the ground. See lines 106 and 215 in this example: https://gist.github.com/Genbox/9b3d2232b6bc22b6c8815487d086c769
Method 2: You can register OnCollision like Method 1 and check if the body in the collision is the ground body. Example here: https://gist.github.com/Genbox/9737d1155efcdd00c9858cf7a492323e