Data provided from CreateEntityOptions.onOverlap. Has a list of collisions and whether or not they exist on the world map.
Example
if (overlapData.entityCollidables.length > 0) { // Ensure there is at least one entity that was collided with constentityCollidable: EntityCollidable = overlapData.entityCollidables[0]; // Get the first collided entity if (enemyID == entityCollidable.entityID) { // enemyID would be the entityID of an pre-defined enemy console.log("The player collided with an enemy!"); } }
Data provided from CreateEntityOptions.onOverlap. Has a list of collisions and whether or not they exist on the world map.
Example