My attack animation just resets my characters idle pose. Please Help

0 favourites
  • 13 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I'm really confused. I don't know why he won't throw I punch. I press p and my character does a reset of his idle animation. I've done everything in the event logs I can possible do animation

  • You would need to add conditions to the other events which call other animations. And have it check to see that the "punch1" animation is not playing. So the "punch1", will basically gain priority. And, the other animations will not play while playing the punch animation.

    For the run events for example. Add a condition below the key down. For the new event condition check if the "punch1" animation is currently playing. But, invert that condition, so it has the Red "X" on it. This will make sure that the run animation is not playing while the punch animation is playing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • if you press p then on the next frame the arrows aren't pressed so it will return to idle, those events dont just magically stop working and pressing p don'T lock the animation in any way

  • brainwavecreations How would I go about doing so?

  • Easy way (Will eventually get messy though)

    Add a condition to your Else - set Animation to "Idle" statement

    (Meaning add more to the left side to make sure you are okay to go back to Idle)

    I would add: Player is currently playing "punch1" - Then right click it and select invert

    So now it will say:

    System Else

    +

    Player is NOT currently playing "punch1" : Set Player to "Idle"

    Each time you add more animations you will have to check to make sure your Player is not actively in that animation by adding it to the Set Player "Idle" statement

  • brainwavecreations How would I go about doing so?

    I would definitely study up on creating a State Machine/System for your game. FoozleCC on YouTube, does a great job with his video here: https://www.youtube.com/watch?v=n7MaVJy76Gw

    I followed his video a while back, and the state machine in my game is now heavily modified, and expanded. The enemies have their own state setups as well. Below is how I do my two of my attacks.

    Then, I basically check to see if certain enemies are overlapping that hitbox. If they are, I put them into their "Hurt" State, which plays the appropriate animation, knocks them back, and takes off a set amount of health through a Function. Functions will make your life easier as well once you begin learning and using them.

    The Player has more attacks, but these two use an animation and a spawned hitbox at a certain animation frame. You can see, how I'm making sure that the Player is not in certain States while attacking. It works the same way for animations, but you would check to make sure the animation is not playing. By, Inverting the condition for "Is Animation Playing", like I do for my State Variable checks here.

    There is also a separate hitbox for the enemies(for some of their attacks), and run checks to if it overlaps the player in certain States. Done in a similar way to the screen grab below. Spawning on a particular frame of their attacking states/animations, then destroying it after a short while. There are many paths to achieve the same end result. The more hours and practice you put in, the easier all of this becomes.

  • Sorry for the double post. So basically, I'm checking to make sure that the Player is not in a conflicting State/Animation. This will prevent the animation from ever playing, if it's not properly checked like this or other way.

    For my Walking animations, I have a bunch of possible conflicting states which are checked with an inverted condition to make sure the Player is not in those States.

    It can get a bit messy doing things this way after a while. There are other ways, like separating things into different Groups. Then Disable the Group with a conflicting State/Animation/Function, then Activate the Group with the conflicting states once the animation and events have taken place.

    I use that method for a Jetpack powerup in my project which uses the same controls as the main player controls. I have them all on a separate event sheet, then disable the main player controls group on its event sheet which has all it's sub-groups for various states and their controls. I basically copied everything to a separate event sheet, and modified the states and animations to be using a Jetpack on his back. Then switch the main control group to disabled while the Jetpack power-up is active, then set it back to active afterward.

    Not sure if that makes sense. But, I definitely recommend watching a ton of video tutorials. Create various types of games. Read through the documentation at least once. I read through it twice, and still reference it all the time while I'm working. Over time, you will expand your knowledge more and more. I'm constantly learning new things, while also referencing other systems I've already created.

  • Easy way (Will eventually get messy though)

    Add a condition to your Else - set Animation to "Idle" statement

    (Meaning add more to the left side to make sure you are okay to go back to Idle)

    I would add: Player is currently playing "punch1" - Then right click it and select invert

    So now it will say:

    System Else

    +

    Player is NOT currently playing "punch1" : Set Player to "Idle"

    Each time you add more animations you will have to check to make sure your Player is not actively in that animation by adding it to the Set Player "Idle" statement

    It semi worked i guess lol I just need to know how to get it to stop Pausing on the last frame And now how to get it to work while running and jumping lol

  • Did you happen to check out that tutorial, at all Jaypixels? I think it will get you off and running with a platforming game. Pause it where you need to, and take your time following along. If you want to anyways, I'm not trying to force you XD. But, it helped me a ton, and it it's been fun to build on top of the end result at the end of the video.

    It can obviously be modified for any game style, and heavily added to. I used all my own art while watching the video, and had just a few areas I needed to change around the math a bit to make everything work properly. Also, had to add a helper sprite for the EdgeGrab area. And, set mine up a bit differently, using the MoveTo Plugin to move the PlayerBox to the proper location either left or right of each platform. Then I just spawn all the edge triggers where they need to be, during the On Start of Layout.

  • I have watched it but it would literally require me to start all over. I might just have to do that at this point lol.

  • I have watched it but it would literally require me to start all over. I might just have to do that at this point lol.

    Yeah, sometimes that is the quickest & easiest way. When I first started on my platformer. I hit at least a couple of spots during the first month, where I ended up just starting over from scratch. Saving the current version as a reference, while starting over with a clean project/slate. One of those starting from scratch moments, I actually had 4 copies going of the same project.

    I was experimenting with 4 different methods to achieve the gameplay mechanic I was looking to create. Until I found the one that worked best for my case scenario. And, would work in the long run as I expand the game. I still do this practice pretty consistently.

    Especially, if I'm adding in something new. I'll just save an extra copy or two of my project, before I start adding in the new feature(s). Then, experimenting with different methods/paths to try and achieve whatever I'm going for. If I get really stuck and have broken a few things along the way, I can always start off from that last major backup where everything was at that time still functional.

    Just having copies of a project at different stages to go back to and reference has been a big help in my experience. I can go in, see where I had made changes from the last big milestone. Find where I may have gone wrong, and figure it out by reference & Debugging :)

    Not sure if any of these suggestions actually help anyone reading this. But, just throwing out what I've learned works for me after the past several months working with Construct 3 fulltime.

    Best of luck with your project!

    I hope you have a fantastic weekend coming up! ✌️

  • Tahnkyou my friend! for the tips! Since seeing this and getting additional tips around the forum it has helped me. But I still have a long way to go! Thanks and have a great weekend!

  • Most definitely :). I'm always happy to help, even if it's just by sharing my own experiences from various areas of life.

    I hear you bud! I definitely have a long way to go myself :). But, just seeing the progress from where I was six months ago, is pretty incredible. I try to relish that feeling of, "I am dumb!" or "That was dumb!". I say a variation of this line pretty much daily, as I work through different roadblocks that present themselves over time. Because, this means that I am still learning! There is no finish line, it is only moved further and further back.

    One step in front of the other, learning one thing at a time. With lots of learning from mistakes/trial & error/etc, as we all do. And, that is forward progress daily/weekly/monthly. Depending on how often you work inside of the application. Like anything it takes time, patience, and dedication. I have no idea how many times I've started in on developing some kind of gameplay mechanic, or even a game. Then decided it would be easier and faster to just scrap what I had done, and start over from scratch XD

    Not sure if I mentioned it earlier, and I'm running on zero sleep today, and also currently recording video tutorials. As such, I am too lazy/busy to check XD. Anyways, I had 4 versions of my current project going at one time. As I was trying to figure out the best way to handle my platformer enemies. I had one project file using various behaviors, another using containers, one using families, and finally one using the family object again but with different behaviors.

    I finally settled on using the Family Object, and found the behaviors that would work best for my scenario. As I am having them use both ranged, melee, and sometimes no attacks(depending on the particular enemy Sprite Object within the overall Family Object).

    Thanks, and you too! My weekend has been great so far, besides the lack of sleep. XD Going to catch up before a golf game planned tomorrow, for sure. Have fun with it as you go, and remember to practice patience with yourself. Talk to yourself as you would a good friend. Everyone moves at their own pace. I know for myself, certain concepts take a very long time to finally sink into my gray matter.

    Take it easy. Peace!

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