Make actor jump at random intervals between .5 to 1.2 seconds?
izzydogham
Member Posts: 24
I currently have an actor that jumps every .9 seconds for .2 seconds at a time. The other day i tried using the random(min,max)
function for ranges of jumps between .5 to 1.2 seconds. It seems it doesn't really work for anyone on the forums. I'm not trying to spawn anything like everyone else i just want it to jump at different intervals. Any help is appreciated!
function for ranges of jumps between .5 to 1.2 seconds. It seems it doesn't really work for anyone on the forums. I'm not trying to spawn anything like everyone else i just want it to jump at different intervals. Any help is appreciated!
Comments
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Can't edit the screen shot... Damn forums
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
You could also choose to make self.random a real attribute and then do Change Attribute self.random to random(5,12)/10 and use self.random as the timer frequency.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Secondly, you have the second timer - the one containing the move behaviour - set to EVERY instead of FOR. It needs to be set to FOR. What you're saying is that every 0.5-1.2 seconds, do the jump after 0.5 seconds.
Thirdly, with a move behaviour in there you need to have the second timer's "Run to completion" option checked.
A fourth thing worth considering is that if you have a lot of random numbers generated in the 0.5-0.7 range, your actor won't have time to fall back down. With 0.5-1.2 frequency and 0.5 duration, a lot of your jumps will be coming one straight after the other. I'd lower the jump duration and increase the move speed, perhaps.
Realistically, the difference between 0.5 and 1.2s is hardly noticeable to the user. Maybe increase those a bit. Really depends on exactly what you're trying to do though.
Attached is an updated screenshot of the rules. I'm assuming your scene has gravity, else the actor won't be jumping so much as move upwards a bit at a time
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Really not sure what your problem might be now. Can you post your rules again?
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Plus I get bored of things as soon as they hit version 1.0 :P
Glad I could help though!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support