Random frame

Get help using Construct 2

Post » Fri Apr 26, 2013 8:54 pm

Hi, pls how to random frame for object1? I have lot of objects1 and need for each random frame... I tryed some solutions but all of my objects1 have got same frame, and i do not want it!
B
24
S
4
G
2
Posts: 318
Reputation: 2,446

Post » Fri Apr 26, 2013 9:08 pm

Have you tried setting up an instance variable for the object and having it generate a random number for that variable when the object is created?Then you can just set the frame to match the variable.
B
15
S
4
G
1
Posts: 168
Reputation: 2,177

Post » Fri Apr 26, 2013 9:26 pm

Yes i tryed it, but no effect.... This solution works in Classic erfect :( but here no :(
B
24
S
4
G
2
Posts: 318
Reputation: 2,446

Post » Sat Apr 27, 2013 7:43 am

Set Animation speed to 0 !!
And in events set "animation frame - to random(n)"

If you have a static animationKurz2013-04-27 07:44:45
B
55
S
19
G
8
Posts: 191
Reputation: 8,831

Post » Sat Apr 27, 2013 8:46 am

I have this:
On start layout: object-> set animation speed to 0 and set objectvar to random(2)

objectvar = 0 -> set animation frame to 0
object var = 1 -> set animation frame to 1

and it does not work....
B
24
S
4
G
2
Posts: 318
Reputation: 2,446

Post » Sat Apr 27, 2013 8:50 am

Why you do this with object var?
Make it:
set animation speed to 0 in animation properties and
On start layout: object->set "animation frame to random(2)"
B
55
S
19
G
8
Posts: 191
Reputation: 8,831


Return to How do I....?

Who is online

Users browsing this forum: flemmig, jeffige, MisterAqua, Nifl and 31 guests