Thank you for helping first.
The SKAction sequence looks like this:
SKAction *seq = [SKAction sequence:@[wait, throwAnim, run]];
SKAction *req = [SKAction repeatActionForever:seq];
Is there any way to make the wait a random duration, or can be controlled during the forever repeat?
You can use waitForDuration:withRange:
Duration parameter represents average wait time, and range represents variation.
Each time the action is executed, the action computes a new random value for the duration. The duration may vary in either direction by up to half of the value of the durationRange parameter.
For example if you set duration to 5.0 and range to 2.0 you will get wait times between 4.0 and 6.0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With