Conflicting Animation States

Get help using Construct 2

Post » Sun Jul 28, 2013 8:27 pm

I'm just starting, I've been through a few of the tutorials, I've covered the manual fairly well, and I've been experimenting successfully with C2. All in all, I really like it. I wish I had more access to code (since I'm a coder by profession) but so far I really like what I see.

However, I'm not exactly sure how to resolve an animation conflict. I have animations set up for when the character is moving, jumping, and idle or standing still. Now I want to add a keyboard event, when 1 is pressed to play an Attack animation. However, it fails to play and I believe it's because of the event condition that sets the Idle or Default animation.

Could someone provide a little (just a wee little) advice on what I should be doing instead of how I'm doing it? Because I imagine this would actually come up quite a bit.

Here are my events:
B
14
S
6
G
1
Posts: 140
Reputation: 1,791

Post » Sun Jul 28, 2013 8:47 pm

I've never done a platformer, but I do see all your animations are set to 'play from beginning' every tick. (they start over many times a second.)

If there is a little green arrow like in the event next to the keyboard icon, then it is a trigger, and fires when the key is pressed.

If that spot is blank, then it actually runs Every Tick.

So if your PlayerBox is moving, it will always be on the first frame of 'Walk'

If the character is moving and falling, it will show the first frame of falling, because it changes to 'Falling (play from beginning)' just after changing to 'walk' animation.

You could try adding 'Trigger once while true' to each, so that it only fires once when ever the event becomes true again.

Does that offer a lead to the problem?Paradox2013-07-28 20:50:46
B
215
S
57
G
32
Posts: 900
Reputation: 38,777

Post » Sun Jul 28, 2013 9:12 pm

I had thought the start from beginning was not what I wanted, but oddly enough moving the character around did appear to play the entire walk animation, not just the first frame as well as the Default or Idle animation. But regardless, I did as you suggested, adding Trigger Once (although truth be told, I've never used that before so am not entirely clear on if it's correct or not), then attempted to add the keyboard press of 1, but it still didn't play the attack animation.

I suppose I'm not nearly as far along the learning path as I thought...

B
14
S
6
G
1
Posts: 140
Reputation: 1,791

Post » Sun Jul 28, 2013 9:27 pm

You should do this tutorial first. It will help.
Building a platform game - a beginner's guide
ImageImageImage
B
71
S
19
G
179
Posts: 3,473
Reputation: 102,662

Post » Sun Jul 28, 2013 10:16 pm

[QUOTE=blackhornet] You should do this tutorial first. It will help.
Building a platform game - a beginner's guide[/QUOTE]

So the first assumption anyone makes is that I haven't done the tutorials. I have done that tutorial, several times. It doesn't have any provision to initiating an attack animation. It still doesn't allow for the Attack animation to play when I press the number 1 on the keyboard. Which is why I tried re-structuring the events on my own. In fact, here is the same key/event setup as dictated in that tutorial.


B
14
S
6
G
1
Posts: 140
Reputation: 1,791

Post » Sun Jul 28, 2013 10:34 pm

some things you can try

disable all other animation triggers except the attack one, does it work?

then check wich animation trigger disables the attack one

if not, is the animation name correct?

if something else, provide capx
ImageImage
B
65
S
19
G
7
Posts: 814
Reputation: 9,691

Post » Sun Jul 28, 2013 10:41 pm

[QUOTE=vtrix] some things you can try

disable all other animation triggers except the attack one, does it work?

then check wich animation trigger disables the attack one

if not, is the animation name correct?

if something else, provide capx[/QUOTE]

Yes, I feel appropriately stupid now. Spelling. Who woulda thunk... I corrected the spelling of the attack animation and it works.
B
14
S
6
G
1
Posts: 140
Reputation: 1,791


Return to How do I....?

Who is online

Users browsing this forum: Kenthria, NN81 and 12 guests