Hello i am new to the Gdevelop and i have a little bit of problem with my melee attack animation can you guys help me
the problem:when i press melee button it only play the first frame and then it stopped
(upload://QwKWGQm9GR2QOFOw3JjIiELrrU.png)
Hello i am new to the Gdevelop and i have a little bit of problem with my melee attack animation can you guys help me
the problem:when i press melee button it only play the first frame and then it stopped
(upload://QwKWGQm9GR2QOFOw3JjIiELrrU.png)
Geesā¦ is hard to tell, why donāt you use the animations names to identify your animations instead of animation0,1,2 you can use properly animation = āAttackā anyway i think the problem is because you are setting an animation when is not moving so that is triggered even if you press the melee button.
Possible solutions
Add a variable to charactermain like isAttacking so later check
if not moving charactermain and charactermain.isAttacking == false
Do idle
And when you press Attack button or meele button
Set charactermain.isAttacking = true
Then
Add another event and check
if animation of charactermain == āAttackā or the number i think in your case is 3
on animation finish
Set charactermain.isAttacking=false
Just a shot in the dark, but your animation is on looping, right?
Ok so question 1 does the attack animation play the whole thing if you hold the control button down? Thatās a good test. Also is charactermain standing still while attacking? Maybe thatās conflicting with the inverted player is moving/set to 0. Question 2 is what is the group of events at the bottom for? Do you even have an animation named āidleā why not use 0 there like the rest or just say animation finished and player not moving. And is it a standalone event or is it supposed to be a subcondition of the attack animation? Anyway Iām befuddle by this whole ordeal.
As UlisesFreitas said, itās because the other events are change the animation. If rcontrol is your melee key then on that pass through of the events it changes your animation but then on the next pass if a direction key is pressed or the players isnāt moving then the animation is changed again.
You need some type of check before changing it similar to your āanimation is/animation finishedā or as UlisesFreitas recommended, you can use a Boolean variable to track the various states.
Each event wouldnāt need a check if you add a check and then make the other events subevents of it.
Try taking your charactermain animation finished/is idle" part and making it a subevent of the RControl key, so it only is triggered once your animeation3 is complete. I also donāt think you need the āis idleā part because you already have that stated in the charactermain is not moving, so it just repeats that what you have already told it to doā¦
Hey can you send me the image of the things you said i donāt kinda understand that