Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: 4ppleseed on March 08, 2014, 12:59:28 PM

Title: Create 40+ objects & then parent them to 1 gameobject (easy way?)
Post by: 4ppleseed on March 08, 2014, 12:59:28 PM
Hi,

I'm currently creating a gameobject (prefab1) and then storing it as a gameobject variable and then setting it's parent to an empty game object - to collect them all in the same place. I'm doing this one by one and it's taking forever! Any way to speed this up?  :o
Title: Re: Create 40+ objects & then parent them to 1 gameobject (easy way?)
Post by: Alex Chouls on March 08, 2014, 01:19:34 PM
Yeah, use a loop to repeat the actions for each object.

Check out PlaymakerSamples\TestLab\Spawning\SpawnGrid for an example. Note, in that sample you can set the delay on Grid Maker to 0 and all the objects will be made in one frame.
Title: Re: Create 40+ objects & then parent them to 1 gameobject (easy way?)
Post by: Lane on March 08, 2014, 01:34:40 PM
I did a Match game quick example that does the loop iterations until completion. It's not perfect but might help you get the idea.

http://hutonggames.com/playmakerforum/index.php?topic=4025.0

Just scroll down in the first post and hit the download on Matchup.

Title: Re: Create 40+ objects & then parent them to 1 gameobject (easy way?)
Post by: 4ppleseed on March 09, 2014, 05:48:38 PM
Thanks guys - I'll try it out :D