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
→
Resolved Questions
→
Spawn Actor acts strange (SOLVED)
Pages:
1
Spawn Actor acts strange (SOLVED)
mvsprojects
Posts: 71
December 16, 2011, 04:00:42 pm
I'm working on a smaller project, next to Boing Ball, and I want to have my character avoide getting crushed by heavy crates. I know how to make the crate spawn within the screen boundaries, but when I test it out in real-time, Crates spawn all over the place! I even set when to spawn a crate and it still spawns like crazy. How can I minimize this?
« Last Edit: December 22, 2011, 12:45:31 pm by mvsprojects »
Boing Ball coming soon...
Co-Opetative coming soon...
MV's Projects- Something to Enable
Hectate
Posts: 4643
December 16, 2011, 05:13:50 pm
The contents of the "always" wrapper will run many times a second, up to 60 I believe. If you just put that in there, it will run the "create actor" code that many times every second - hence you have too many spawning.
Use the time blocks to limit how frequently one is created. Also, don't put the time blocks in under always or it will only get worse, use the "when created" wrapper instead and the "do every" block fr timing.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.
mvsprojects
Posts: 71
December 17, 2011, 08:35:07 am
It is better, but the random spawning only got slower, so, what can I do now?
Boing Ball coming soon...
Co-Opetative coming soon...
MV's Projects- Something to Enable
rob1221
Posts: 9472
December 17, 2011, 09:49:34 am
Put that spawning block under "when created" instead.
https://twitter.com/Rob1221dev
Hectate
Posts: 4643
December 17, 2011, 11:15:46 am
1. You're using an Actor Behavior. I suggest using a Scene Behavior to control spawning actors. If you have it as an actor behavior and that actor gets removed, your behavior may cease to operate as intended.
2. Move your blocks to When Created as previously noted.
3. If you want them to spawn more frequently, use a smaller amount of time. Right now you have it set for every 2 seconds. You could set it for 1 second, or .5 seconds (a half of a second), or however long you want it to be between new blocks.
:
:
Patience is a Virtue,
But Haste is my Life.
Proud member of the League of Idiotic Stencylers; doing things in Stencyl that probably shouldn't be done.
mvsprojects
Posts: 71
December 22, 2011, 12:45:20 pm
Thank you. The behavior is fixed and I can now continue.
Boing Ball coming soon...
Co-Opetative coming soon...
MV's Projects- Something to Enable
Pages:
1