Jump to content

How to alter player hitbox?


Recommended Posts

How would I go about altering the player's hitbox/hit area? I've looked through the documentation but can't see how to implement it.


Those looking at this in the future, to solve this:

         this.sprite = this.physics.add
            .sprite(100, 450, 'Player', 0)
            // Reduce hit box size
            .setSize(24, 20)
            .setOffset(8, 12)       

So, to reduce hitbox size you use setSize(px, px) and use setOffset(px, px) if the box moves around


Link to comment
Share on other sites


  • Recently Browsing   0 members

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