Assigning Animations?

For questions about using Classic.

Post » Sat Nov 26, 2011 6:57 pm

Alright, maybe this is just me missing something but I can't seem to find this anywhere so here's the problem.

I have a character with an Idle animation, a Walking Animation, and various other animations like Attack, Block, etc. The Idle animation is set to play when the character is not moving, and the Walking animation is set to play when the character IS moving. This works fine and dandy. But the Attack animation is set to play when the Left Mouse Button is clicked, but when I click the Left Mouse Button, the animation glitches for a second and just continues to be idle, like it's trying to play the Attack animation but goes back to Idle anyway. I know this probably has something to do with him still not moving and clicking the button at the same time but I dont know how to separate the two.
B
3
G
1
Posts: 5
Reputation: 510

Post » Sat Nov 26, 2011 7:01 pm

Yeah your animations are conflicting. I normally have multiple groups for animations, then toggle them on or off so they don't conflict.

Try putting all your 'basic' animations in a group like walking, idle, jumping, falling, etc. Then put your attacking ones in another group.

When you attack, deactivate the basic animation group. When the attack animation is finished, or your attacking value is 1 but the animation is not playing, re-activate the basic group and deactivate the attacking group.

You can also just add more conditions like "Play idle if attacking is 0" but that can get messy.
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sat Nov 26, 2011 7:09 pm

There are some good examples of state based platform engines on the forum that will probably help to solve this. Do a search for those terms and you should find them fairly easily, one was by Minor, the other was by another member (forget who) but I think it was called 'Super Platformer' or something like that. It was much more complex and used the function object but was very impressive
B
15
S
6
G
6
Posts: 103
Reputation: 2,968

Post » Sun Nov 27, 2011 3:39 am

Tokinsom, your grouping idea worked like a charm, thank you! And untune, thank you for directing me towards those forum topics, I took a look at them and they are actually pretty helpful for other things as well.
B
3
G
1
Posts: 5
Reputation: 510


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 7 guests