Collision Detection
deepaksinghkushwah

Hi All,

 

Is there any way to know collision detection with other object?

 

Please let me know.

 

Regards

All 2 Comments
Gio
If you want to know which objects are colliding with your object you can use SceneObject.getOverlappingObjects()
 
From the documentation:
 
{Array} getOverlappingObjects(searchAllLayers, precision)
Get an array of objects overlapping this object
 
Parameters:
{boolean} searchAllLayers Optional
Whether to extend the search to all layers. This is false by default, meaning that only overlapping sprites on the same layer will be considered.
 
{string} precision Optional
How accurately to search for overlaps. This can be either 'axis-aligned' (which would consider the axis-aligned bounding box of the sprites), or 'oriented', which takes into account the rotation of each sprite. Default is 'axis-aligned'.
 
Returns:
{Array} All the objects that are overlapping this object
deepaksinghkushwah

Thank you Admin. That help me a lot.

Post a reply
Add Attachment
Submit Reply
Login to Reply