Posted By: CBSection31
Randomize and actions - 06/06/07 02:21
Hey everyone,
I have several models next to each other in a level that all have the same action assigned to them. The action has a loop that calls for the model to move via c_move after a random period of time. I have set this up using the random command. I have randomize() set up properly (I think), so that the time before they move varies every loop.
So basically, it works something like this:
Code:
The problem is, each model that has the action moves at the same time. So, each loop the value of looptime changes successfully. BUT, the value of looptime is the same for EVERY model assigned the action.
Is there a way for the value to be random for each model, even if they share the same action?
Thanks!
I have several models next to each other in a level that all have the same action assigned to them. The action has a loop that calls for the model to move via c_move after a random period of time. I have set this up using the random command. I have randomize() set up properly (I think), so that the time before they move varies every loop.
So basically, it works something like this:
Code:
action lalala
{
var looptime;
while (1)
{
randomize();
looptime=int(random(100))+20;
wait(looptime); // wait between 20 and 120 ticks
c_move (blahblahblah);
}
}
The problem is, each model that has the action moves at the same time. So, each loop the value of looptime changes successfully. BUT, the value of looptime is the same for EVERY model assigned the action.
Is there a way for the value to be random for each model, even if they share the same action?
Thanks!