Hi to all, im new here and i have a couple of questions. Im struggling to make overlap functionality.
For example i create zone around the player or object or just place that zone on the map.
I want if i enter in that zone to show text and if i leave zone to hide that text.
The problem is body.touching is working only if the player is moving i assume its working on velocity only, and soon as i stop moving inside of zone text disappear because phaser doesn’t register body.touching.
Is there any way or trick to know if bodies/zones are overlapping/touching if im not moving inside of them?
Set the state?
As long as you haven’t moved out, you’re still in
So instead of checking body touching constantly, only use the enter/exit.
Or you could keep setting the handler in update, but that’s obviously not a good idea…
You are lifesaver! Thank you very much. I tried already same solution like your is,but it was not working thats why i reached forum. After examine my code again with your code example i found i had problem with class inheritance variable that didnt notice until i didnt try your code and that why this was not working!