World:isCollisionEnabledBetween
EditReturns whether collisions are enabled between a pair of tags.
enabled = World:isCollisionEnabledBetween(tag1, tag2)
Arguments
Name | Type | Description |
tag1 | string | The first tag. |
tag2 | string | The second tag. |
Returns
Name | Type | Description |
enabled | boolean | Whether or not two colliders with the specified tags will collide. |
Notes
If either tag is nil, this function returns true, for convenience. For example, the following function will still work if either of the colliders don't have a tag:
function willCollide(c1, c2)
return world:isCollisionEnabledBetween(c1:getTag(), c2:getTag())
end
By default, collision is enabled between all tags.
Tags can be marked as "static" when the world is created, as an optimization hint. Static tags will never collide with other static tags, regardless of whether collision is enabled between them.