CollideAgainst
Introduction
The CollideAgainst function returns whether one shape/ShapeCollection is touching another shape/ShapeCollection. CollideAgainst does not modify the positions or velocities of either of the callers, it simply returns true/false.
Common Usage
CollideAgainst is often used in the following situations:
Damage-dealing collision such as a player entity vs. a bullet entity.
Game triggers, such as an area marking the end of a game.
CollideAgainst and Z values
All shape collision for 2D shapes (that is, all shapes except AxisAlignedCube and Sphere) consider only X and Y values when testing for collision. This means that the Z value is ignored. Therefore two shapes which are at different Z values will trigger a collision. For example:
Last updated