Skip to content
Advertisement

How to handle collisions in Phaser

I want to make objects push away from each other in my Phaser game (arcade physics). To do so I’ve tried to use the collider function:

JavaScript

But I always get TypeError: undefined is not an object (evaluating 't.isParent')

It looks like this is error rises during the update process as it’s risen thousand times a minute…

I’m using Phaser 3

Does anyone know the answer?

Thanks!

Advertisement

Answer

Turns out you have to put those collider functions in the update loop…

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement