Learning expressions

Moderators: Disciple, zlovatt

Post Reply
gtoschi
Posts: 1
Joined: December 9th, 2005, 1:14 pm

I am learning how to use expressions. What numbers would the following code return at say time=4 seconds.

life = 1.2; //life of particle

seedRandom(1,true);
delay = random(life);
if(time < delay){
age = 0;
seed = 0;
}else{
age = (time - delay)%life;
seed = Math.floor((time - delay)/life) + 3;
}
[seed,age] :roll:
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

Well for me, at 4 seconds it returns an array of two values [5, 1.1]. The expression above will only work on a 2 dimensional property such as position or scale.

But I'm not sure what you're really asking. Is there something you want to do, but need help writing the correct expression?

Paul T
Post Reply