Lukich Posted April 4, 2005 Share Posted April 4, 2005 hello. i have a quick question - i'm trying to create an expression that qould rotate my object to 45 degrees or one of it's multipliers. it was fairly easy to create one, which rotates the object every frame: int(rand($FF)*10)*45 but how would i make the new value being generated every 30 frames, for example? i was experimenting with using modulus, but no luck so far. does anyone know? thanks a lot, luka Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 4, 2005 Share Posted April 4, 2005 Have you tried int(rand($FF%30)*10)*45 Quote Link to comment Share on other sites More sharing options...
deecue Posted April 4, 2005 Share Posted April 4, 2005 hey lukich, your problem is in the rand.. you are still generating a random number (0 to 1) every frame... this should get you where you want to be (with the "30" in "$F/30" being how often, in frames, it randomizes) int(rand(int($F/30))*10)*45 Quote Link to comment Share on other sites More sharing options...
deecue Posted April 4, 2005 Share Posted April 4, 2005 Have you tried int(rand($FF%30)*10)*45 17294[/snapback] the modulus here is good for creating a loop of the same 30 randomizations over and over again, but will still generate a value every frame.. this is because $FF%30 alone is a different number every frame in itself.. Quote Link to comment Share on other sites More sharing options...
Lukich Posted April 4, 2005 Author Share Posted April 4, 2005 it's alive! my preciousss!!! thanks deecue Quote Link to comment Share on other sites More sharing options...
sibarrick Posted April 5, 2005 Share Posted April 5, 2005 the modulus here is good for creating a loop of the same 30 randomizations over and over again, but will still generate a value every frame.. this is because $FF%30 alone is a different number every frame in itself.. 17296[/snapback] Whoops, misunderstood the question. sorry. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.