Author Topic: Problem with hitbox of animated sprites  (Read 1728 times)

IceFreaki

  • Trial Wannabe
  • Posts: 4
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Firefox 39.0 Firefox 39.0
    • View Profile
  • Playstyle: Keyboard
Problem with hitbox of animated sprites
« on: July 26, 2015, 11:33:27 AM »
Hey everyone!
So I've recently started to mess around with Game Maker again after a short break of just 4 years and I've been having quite some fun so far.
But I kinda found a lil' problem with one of the objects I'm using. It's an animated sprite and wiggles around a bunch and well, I'll explain with a few pictures to make it clear.

The animated sprite uses 30 frames and one of those frames looks like this:
(click to show/hide)

See that leg that's sticking out? That should obviously kill you if you dare touch it. Now to another frame that comes a bit later.
It looks like this:
(click to show/hide)

The Guy should be able to fall through but the game still uses the earlier frames as the hitbox (or rather, the hitbox of all frames together). The transparent leg is where it was on the earlier frame and shouldn't harm the Guy since it's not there.
But sadly, that isn't the case and well, Guy dies to the invisible leg.
(click to show/hide)

Does anyone know how I can make it so that it only uses the hitbox of the frame that is currently displayed and not as if all frames are one frame or something like that...

Thanks~
Boop

Sudnep

  • Global Moderator
  • Spike Dodger
  • Posts: 124
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.107 Chrome 44.0.2403.107
    • View Profile
  • Playstyle: Keyboard
Re: Problem with hitbox of animated sprites
« Reply #1 on: July 26, 2015, 11:52:19 AM »
images explains it better
(click to show/hide)

IceFreaki

  • Trial Wannabe
  • Posts: 4
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Firefox 39.0 Firefox 39.0
    • View Profile
  • Playstyle: Keyboard
Re: Problem with hitbox of animated sprites
« Reply #2 on: July 26, 2015, 12:49:41 PM »
Oh wow, that's easy

Thank you so much!
Boop