Jump to content

Arcade Physics: Invisible sprites not colliding


mariogarranz
 Share

Recommended Posts

for me, when setting alpha = 0 collision works okay, when visible is set to false - don't work.

 

When `exists` is set to `false` it will remove its physics body from the physics world if it has one. It also toggles the `visible` property to false as well.
Link to comment
Share on other sites

This is normal - Pixi skips all 'visible false' Sprites from the update transform, so their position never changes or propagates, where-as alpha 0 sprites are just skipped for rendering (you could equally do Sprite.renderable = false, which is a cleaner way of doing it imho). This won't be changed in any Phaser 2 release as it has been like this for years now so would be too much of a change. It's something we did address in Phaser 3 however (the issue is semantic really, i.e. the naming of things vs. expected behaviour, rather than technical).

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...