Animation does not start

For questions about using Classic.

Post » Thu Mar 26, 2009 8:14 pm

>Left mouse button is down
+ sprite: set animation to "Shooting".

When I click left mouse button, it only shows the 1st frame.
When I let go and click left mouse button again, it shows another (seemingly random) frame.

- sprite has Animation called "Shooting".
- This animation has angle 0 degrees.
- 0 degrees-angle has 4 frames.
- Animation has turned on option "loop".

I would like to start the animation, by clicking on the mouse button running the frames, but it doesn't.
B
16
S
5
G
7
Posts: 599
Reputation: 5,000

Post » Thu Mar 26, 2009 8:37 pm

That is because "mouse is down" condition triggers continuously as long as the mouse button is down, thus starting the animation over and over and over each tick.

Add "trigger once while true" condition or use "mouse button pressed"
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Post » Thu Mar 26, 2009 10:23 pm

[quote="Mipey":jfpj839z]That is because "mouse is down" condition triggers continuously as long as the mouse button is down, thus starting the animation over and over and over each tick.

Add "trigger once while true" condition or use "mouse button pressed"[/quote:jfpj839z]

Thanks, I'll try that out.
Stupid me.
B
16
S
5
G
7
Posts: 599
Reputation: 5,000

Post » Sat Mar 28, 2009 12:44 am

[quote="Mipey":1ctvm0et]That is because "mouse is down" condition triggers continuously as long as the mouse button is down, thus starting the animation over and over and over each tick.[/quote:1ctvm0et]

That's exactly what I want.

I don't understand the following: when I set animation speed to 10 or 20, I only see 1 frame.
Animation speed set at 50, it jumps, seemingly random, from the 1st to the 2nd frame. In a non-constant way. (completely destroying the illusion of animation/movement)

I wish to achieve the following result:
As long as mouse button left is down, animation of 2 frames starts (gun-shooting animation).
Mouse button released: frames of gun-shooting animation are no longer seen.
B
16
S
5
G
7
Posts: 599
Reputation: 5,000

Post » Sat Mar 28, 2009 8:31 am

Just use On Click to set the animation.

On left mouse button clicked => set animation to "shooting"

Since it's looped, it will repeat itself from now on of course.
Now make a new event like this:

Left mouse button is NOT down (inverted condition) => set animation to "default" (or whatever your idle animation is called).

That should work.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Sat Mar 28, 2009 5:39 pm

Thanks for the reply.
While testing your suggestion, I found out that a previous ELSE-condition was interfering with this new shooting-animation-condition, resulting in unpredictable behaviour.
B
16
S
5
G
7
Posts: 599
Reputation: 5,000


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests