Phaser API Documentation

  Version: 
nextCategory()

Description:

Returns the next available collision category.

You can have a maximum of 32 categories.

By default all bodies collide with all other bodies.

Use the Body.setCollisionCategory() and Body.setCollidesWith() methods to change this.

Returns:
Description:

The next collision category.

Type:
  • number
Since: 3.70.0