Animation frame is random(0,2), why is Frame 3 being shown

Just started using Construct 2? Post your questions here

Post » Thu Mar 05, 2015 10:23 am

The issue is likely that the speed of the animation is not set to 0 and as such it does display the last frame of the animation.
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
276
S
103
G
84
Posts: 7,289
Reputation: 83,098

Post » Thu Mar 05, 2015 3:29 pm

codah wrote:Have you set animation speed to zero?


That would explain why it's getting yellow at the start, but never again.

if the animation got the 3 then stopped, all subsequent changes would be permanent.

That might also explain why some get there faster then others, if some are set to frame 2.

A plan is beginning to form. I'll do some tests and post the results up.
B
5
Posts: 10
Reputation: 250

Post » Thu Mar 05, 2015 3:33 pm

JamesXXXYZ wrote:(0,2) are 3 frames 0,1,2.
(0,1) is correct.


codah wrote:
JamesXXXYZ wrote:(0,2) are 3 frames 0,1,2.
(0,1) is correct.


That's what I thought, but the manual says it doesn't include the upper number.

random(a, b)
Generate a random float between a and b, including a but not including b.

So the manual must be wrong.


danuyos wrote:do you have more than 3 frames?.. if not, just use choose(0,1).


This behaviour of random is pretty common across platforms. It would be horrible if random(n,m) could return both n and m as the the space between n + 1 and m - 1 would be different.
B
5
Posts: 10
Reputation: 250

Previous

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests