Jungle Platform Attack Animation

0 favourites
  • 9 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • Good afternoon all,

    Hate to bug people but this has been hassling me for couple hours now and i cant for the life of me figure this out.

    Ive made a dummy sprite to test the Jungle Platform melee attack on but i cant seem to get the animation to run correctly.

    Just as a test im trying to get it so when a certain key, in this case left shift, is pressed, the attack animation runs and if it collides with the dummy then the dummy will lose "1" from its DummyHealth variable.

    Any suggestions?

    A few more problems like this to work around and then i should be close to releasing my first C2 game! Such excite!

    Thanks in advance :)

  • on key pressed "shift" set animation to "attack"

    Character on collision with dummy dummy subtract 1 from health

    Just make sure your attack animation has it's collision polygon placed correctly. Another option would be to spawn a hit sprite on your sword and set it to the tip of your sword while the melaa animation is running.

    Instead of on collision, sometimes it's better to use is overlapping and trigger once while true.

  • If this doesn't work, please make sure you haven't any conflicting events. Like for instance if character isn't moving play stance, or if character is on floor play whatever.

  • Okay so ive taken what youve said into account and this is what i have:

    ____________________

    Event: Keyboard, Shift Pressed. Action: Player, Set animation to attack

    Event: Player, Collision with Dummy. Action: Dummy, subtract 1 from DummyHealth

    Event: Dummy, DummyHealth </=0. Action: Dummy, Destroy

    ____________________

    My problems now are that:

    • I dont even need the attack animation to run, i can just pass the dummy and it loses health
    • When the attack animation does run, it doesnt return to Idle

    I KNOW ive gone wrong somewhere but still learning C2 so please bare with me.

    I appreciate your time and effort with this :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1. Add a condition for player collision > Attack anim must be playing

    2. Attack animation On finished > Player set anim idle

  • Add a condition is animation attack playing to the on collision event.

    and an on animation end set animation to idle

    Ninjaaad by

  • Just quickly:

    This "2. Attack animation On finished > Player set anim idle "

    Would that be a seperate event or a subevent for the attack animation on keypress event?

  • He may already be responding but yes separate event on its own should be fine. You want the player to return to an idle stance after finishing the attack in all situations I would assume.

  • That is correct yeah.

    The animation side of things is now working, just have to get the collision thing working. Im sure the events are correct but i'll mess around with it for a bit and see what i can come up with.

    Thank you both very much for your guidance :)

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