TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Randomizing when actors spawn [Solved]
Pages:
1
Randomizing when actors spawn [Solved]
Edge123
Posts: 62
October 18, 2019, 10:09:57 pm
I've been trying to make an actor spawn obstacles at random times, but it keeps choosing a specific timed pattern rather then having a randomized timed pattern. This is the code I have for the actor:
https://imgur.com/a/KbgIXKT
How do I make it so spawning the actors have random timed patterns?
« Last Edit: October 19, 2019, 11:52:04 am by Edge123 »
merrak
Posts: 2738
October 18, 2019, 10:38:52 pm
Quote from: Edge123 on October 18, 2019, 10:09:57 pm
it keeps choosing a specific timed pattern rather then having a randomized timed pattern.
The loop delay is set when the repetition is started and cannot be changed. What you can do instead is use 'do after N seconds' wrappers. Set the delay to a random value. At the end of the delayed behavior, set the delay to a new random value and use another 'do after N seconds' wrapper.
`/\=======/\"-
Website! -
http://www.anorthogonaluniverse.com
Facebook -
http://www.facebook.com/rlwatson
Twitter -
https://twitter.com/merrak
Edge123
Posts: 62
October 19, 2019, 11:51:56 am
It all makes sense when using the "do after N seconds" block. Don't know why I didn't notice that before, but anyways, appreciate the help.
Pages:
1