Problem with Sprites

Hi, I just started my first project with Phaser 3. I was working on a collision with two sprites in a group and was having some problems so I decided to turn on the debug mode for Arcade physics. When I looked at my sprites then, they looked like this.

Screenshot%20from%202019-05-03%2000-46-32

The bounding boxes are way outside the actual sprite for some reason. I simply created the sprites with

arrow = this.physics.add.sprite(170,490, 'arrow')

Here is the original image that I loaded.

arrow_resized

How is this happening?

Edit: I did do

arrow.scaleX = -1

to flip the image since I needed the arrow in the other direction. The other arrow which I did not flip seems to be within bounds. Is it happening because Iā€™m flipping it?

Hello @3141bishwa!

If you want to flip your sprite in the x-direction you should use the setFlipX function and then the collider box will be placed at the correct position.

arrow.setFlipX(true)

2 Likes