We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f5c0828 commit 001f63fCopy full SHA for 001f63f
1 file changed
en/manual/physics/physics-queries/overlaps.md
@@ -105,9 +105,12 @@ public bool CheckGrounded(BodyComponent body)
105
// Checking every layer except the one the player is on
106
var mask = ~body.CollisionLayer.ToMask();
107
108
- Stack<CollidableStack> buffer = stackalloc CollidableStack[1];
+ Span<CollidableStack> buffer = stackalloc CollidableStack[1];
109
110
// If there are any collisions under the player, the player is on the ground
111
- return sim.Overlap(sphere, pose, buffer, mask).Any();
+ foreach (var item in sim.Overlap(sphere, pose, buffer, mask))
112
+ return true;
113
+
114
+ return false;
115
}
116
```
0 commit comments