Resize player and hitbox?

0 favourites
  • 4 posts
From the Asset Store
Simple resize and rotate events for any sprite, quick and easy event sheet that you can use for your own projects.
  • Okay, so I have a couple power-ups here. One increases your size, the other decreases it. The problem I am running into is that the hitbox does not stay in the right position.

    When the height increases, the hitbox ends up a foot too low. It's the right size, just it moves down, and I can't get it back up onto the player properly. So, he ends up standing a foot off the ground.

    When the height decreases, the opposite happens. The hitbox ends up a foot too high, and he sinks in the ground.

    I have the player pinned to the hitbox at the start of the layout.

    I set the first power-up to increase scale when touched. It sets the scale of the player to 0.9 and the hitbox to 1.2. That makes them a little bigger and about the right size.

    I set the other power-up to decrease the player's scale to 0.5, and the hitbox to 0.7. It makes them smaller, as it should.

    How do I get the hitbox to be in the right position? I tried a few things with set position, pin and unpin, and whatnot, but nothing really made it move to the right position. It always ends up either a foot too high or too low.

  • Just did a quick demo, as long as your origin point for the pinning is at the bottom of both sprites, then it'll scale without embedding/floating into the scenery. :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks, I got it sorted! :)

    I had to move the origin of the hitbox to the bottom-middle. Not sure what it was doing way up in the exact center. Usually I move them down.

    I guess I moved the origin points for the player, but not the hitbox.

    It's always the little things, lol.

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