Platformer : why do we need to use an hitbox?

This forum is currently in read-only mode.
From the Asset Store
10 Retro songs ideal for platformers or farming games
  • Hi there!

    In almost all tutorials I've seen/read about platformer with Construct Classic it says to use an invisible hitbox and to set position of the picture of your charachter to follow the position of the hitbox.

    And I don't really get why ?

    Why is it not adviced to directly assign the platform behavior to the picture of your charachter ?

    Thanks for clearing this thing up to me

    Cheers!

    // izioq //

    R0J0hound Sorry to tag you but you're kind of a Construct god here

  • As far as I know it is not mandatory for C2.

    Other engines need a hitbox to work correctly.

    But it still makes sense to use one

    • If you change the animation of your player the hitbox stays the same
    • you can make your player out of a lot of different smaller sprites (like head, weapon,...) but only need to check collision on the hitbox
  • Thanks for your reply!

    " - If you change the animation of your player the hitbox stays the same "

    That's my problem in fact : when my player jump he is smaller than the hitbox and if I make the hitbox stretch I got some issues when it hits the ground (screen shaking)

    However in the game I'm working on, there are no enemies (but the player will still have to pull triger, toggle switch, etc.)... so maybe I don't need an hitbox in fact ?

  • I think you can make it without a hitbox, but you also could switch to a smaller hitbox when player get's small.

  • Thanks: I'll give a go without a hitbox

  • izioq - You should always use a hitbox on platformer games since any change of collision points or size of the player will produce a glitch on solid objects.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • That's an important precision thank you very much !

  • Don't forget that cc allows you to make custom collision masks for your sprites and use that mask on all animation frames .

  • Just how much slower does is the game if I use more than 8 points on my hitboxes?

    I've seen pixel-perfect collisions in other game engines without slowdowns.

    Don't get me wrong; I have no problems with using a standard square hitbox for my character (afterall, Mario speed runs would be very difficult if collision were pixel-perfect) but it's also nice to have the option.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)