Spawning and Particle Issues
Kozax
London, UKMember Posts: 9
Hello,
I need some help with two different issues I have with spawning.
When the game starts I randomize one attribute random(0,1)
Made a rule to spawn character1 on "0" and character2 on "1". It only spawns character1When an actor is destroyed, I create another actor that has particles behavior, but for some reason the particles have a small delay and they don't start spawning as soon as the actor is deleted.
Thank you for reading!
Comments
Welcome @Kozax
To your questions,
In the current version, the random() function has a problem and will always give the same number the first time. Workaround is just to call the random function twice on startup. Subsequent calls are random. It is a LUA issue on MAC, only happens in the creator and GS is working on a fix.
Your "number of particles" is probably small, in relation to the "startup time" and "particle life time". The particle generator tries to spawn the set "number of particles" at a random time interval set by "startup time". So, e.g. if you only spawn 2 particles at a startup time of 2, it may be that both particles only spawn after almost 2 seconds.
Play around with those values until you are happy. Alternatively, if you only want a small number of particles (maybe 8) to spawn instantly, then rather spawn those particles as actors.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
@Hopscotch Thank you for your quick reply!
I searched online for a documentation and I only found a pdf describing briefly each behaviour. Is there any other place with more information? For example, I would like to know what does startup time means exactly.
Also, I am using: Number of Particles: 10 and Startup Time: 0
The problem is, when the actor collides, it spawns one particle and after a while a couple more.
If you have any solution in mind it would be great!
Particles can be tricky, usually takes time and experimentation to get the perfect settings.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
@Kozax the particle system is not well suited for a quick explosive effect like I think you are trying to achieve. For this purpose, I always spawn a handful of actors myself instead of using particles.
The "startup time" is the initial interval over which the max number of particles get spawned. You can try a very short startup time (+-0.1s) and a biggish number or particles with a long lifespan. It will come close to what you may want.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
To get a lot of particles quickly I do what @Hopscotch said but instead of spawning many particles in one particle effect, ill spawn few particles BUT use several copies of the same particle effect actor at the same time. Hope that makes sense.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Thank you @jamie_c and @Hopscotch for your suggestions.
I created another actor and used him instead of using a particle system .
I was wondering, instead of copy and pasting Spawn Actor behavior is there any way to say repeat x times a specific behavior?
Soon yes Look out for the 1.25 release.
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Cheers mate