Jump to content

Phaser Collision not working as expected in Arcade


mblox
 Share

Recommended Posts

 

I have a man sprite (man) and a group of tree sprites (trees) setup with collision like this:

this.game.physics.arcade.collide(man,trees);

It works fine for the most part EXCEPT the man can walk UP into the tree (see below). Collision detect is working fine in all other directions (LEFT, RIGHT and DOWN, but not UP). Is this a bug? Gravity related or am i doing something wrong.

921vW.png

See Video: http://screencast.com/t/j5tLsqpO

 

Link to comment
Share on other sites

I think the issue will be a bug in your code.

As for the amount of overlap shown in your screenshot, that doesn't look like what a player would think of as a collision - presuming both the man and the tree are standing upright (rather than lying down against the ground) then the player expects the collision to be some area around what they see as the bases of the sprites... a man standing on the ground doesn't find their feet colliding with the top of a tree where that tree is as tall as the man and on level ground!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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