Skip to content

Commit 8eb82e4

Browse files
Fix for collideGroupVsSelf is undefined
This happens when you call collide with a single group as the first param. Seems like the `collideGroupVsSelf` function was not implemented. I've changed it to just call the `collideGroupVsGroup` with the first object twice which worked when I tested it on my project.
1 parent 9379714 commit 8eb82e4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/physics/arcade/World.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,10 +1364,11 @@ var World = new Class({
13641364
*/
13651365
collideHandler: function (object1, object2, collideCallback, processCallback, callbackContext, overlapOnly)
13661366
{
1367+
// Collide Group with Self
13671368
// Only collide valid objects
13681369
if (object2 === undefined && object1.isParent)
13691370
{
1370-
return this.collideGroupVsSelf(object1, collideCallback, processCallback, callbackContext, overlapOnly);
1371+
return this.collideGroupVsGroup(object1, object1, collideCallback, processCallback, callbackContext, overlapOnly);
13711372
}
13721373

13731374
// If neither of the objects are set then bail out

0 commit comments

Comments
 (0)