Detector not keeping up

0 favourites
  • 5 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Hi

    In my platform game I'm using a detector/Hitbox which is positioned to an image point every tick to as a way of determining when a enemy recieves damage from the players weapon but while jumping in the air my hitbox doesn't keep up with the players image point can anybody tell me what I'm doing wrong?

    (It's the most noticable when you leap from the first ledge and have the extendable upgrade)

    relevant controls are

    z to jump

    X to Attack

    the pots are upgrades

    dl.dropbox.com/u/56373295/Construct%202%20Files/Platform%20Game.capx

    Sprites are not mine they are from a game called Goemon, I just felt like using them as placeholders while I figure out most of the programming for my own game.

  • Probably because you only spawn it, you have to set its position to the image point as long as the attack is playing... And you should have this image point on all your attack animation frames.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm not sure I follow

    I was certain I had the image point on all my attack animation frames, in which frames is it missing? Also I've added the event you described to position it while attack is playing but it doesnt seem to have made any difference.

    Here is he file of my attempt at following your instructions with a few of the unecessary events & animations removed as well because they were beginning to make things confusing for me.

    dl.dropbox.com/u/56373295/Construct%202%20Files/Platform%20Game%20second%20attempt.capx

  • for the image point thing, I was just being cautious, I hadn't checked when I wrote that.

    There's indeed a tiny offset when you fall. Offset like that often happens for very fast movement, and in your case I don't think it will really be that noticeable once you make the hitbox invisible.

    It will still be accurate enough I think.

    Anyway, mmmmmm

    ok I found the issue. The pin behavior seems to work after the hitbox positionning event occur. So the hitbox is always one frame late.

    Solution: don't use the pin behavior and make sure you position the animation sprite to the detection sprite before positionning the hitbox.

  • Thanks a bunch

    I really appreciate the help Yann, I'd have never figured that out

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