|
Post by baroquedub on Jan 29, 2018 22:25:47 GMT
Did a quick search and couldn't see if anyone has asked this before... What would be a good way to spawn randomly across a two floor map? (once only spawning things like health pick-ups, not enemy waves)  So yes I can add lots of empty gameObjects and have a script randomly pick out a few from the array and spawn at that Transform. Just wondered if there was a clever way of doing it? 
|
|
|
Post by DarkTonic Dev on Jan 29, 2018 22:36:48 GMT
Yeah there's already something for this called Wave Offsets in each Spawner Wave, but it's "relative".
Or you could just use Triggered Spawners and listen for a Custom Event that you fire and have the Custom Event pick "random 3" spawners to use or whatever.
|
|
|
Post by baroquedub on Jan 29, 2018 23:04:02 GMT
Yes, I've used Wave Offsets in the past, but I can't figure out how to stop spawning in mid air. Thinking it through now, I guess my spawned prefab could fire a raycast down, OnSpawned, and if it didn't hit a floor, then it would despawn and try again. Thanks for the quick response. Just talking it through go me to a solution 
|
|
|
Post by DarkTonic Dev on Jan 30, 2018 0:44:36 GMT
I personally would just set up a bunch of Triggered Spawners with a custom event, and each of those would be in the precise spawn position so you don't need to do any Vector math. But they both will work.
Custom Events can do just about everything.
|
|