waku
New Member
Posts: 7
Posts: 7
|
Post by waku on Sept 10, 2015 22:29:09 GMT
Hello,
I'm trying to link 2 prefab I "instanciated" with my wave but I did'nt figure how to do this. I'm trying to create a sun and a planet rotating around the sun but for this I need get a reference on my planet. Can you help me with this ? Thank you.
|
|
|
Post by DarkTonic Dev on Sept 11, 2015 1:03:05 GMT
Easiest to just make a new prefab that has both combined. I can't think of a reason that would be bad?
|
|
waku
New Member
Posts: 7
Posts: 7
|
Post by waku on Sept 11, 2015 5:17:22 GMT
Thank you for your quick answer, it can be a solution but if I do this I will not be able to choose how many planet are rotating around the sun. I also have differents type of prefab (differents sprites and colors).
|
|
|
Post by DarkTonic Dev on Sept 11, 2015 5:20:31 GMT
Yes, and you can have a different prefab for each of them. Then you put them all in a Prefab Pool and spawn them with weighted randomness if you want.
If you don't want to do that, you'll have to subclass the spawner class and override the SpawnOneItem method to do what you want.
|
|
waku
New Member
Posts: 7
Posts: 7
|
Post by waku on Sept 11, 2015 5:29:10 GMT
Thank you I will do it this way. Thank you for your lightning speed answer 
|
|
|
Post by DarkTonic Dev on Sept 11, 2015 5:35:30 GMT
No problem.
|
|
waku
New Member
Posts: 7
Posts: 7
|
Post by waku on Sept 11, 2015 7:22:45 GMT
I'm back, I tried it works quite well, I now randomize size, colors, sprites by script attach to planet's prefabs. I now have multiple sun prefab with 1, 2 or 3 planets children which are rotating around them. I also have attached a killable script on planets to be able to destroy them but I have one error I don't understand.
"The Transform 'planet' passed to Despawn is not in Pool Boss. Not despawning."
In fact my planets are in pool boss but suns prefabs are. Do I really have to add all the children planet to the Poll boss ? Because all the planet children prefabs are the same.
Thank you for your help.
|
|
|
Post by DarkTonic Dev on Sept 11, 2015 15:20:06 GMT
Yes, anything you despawn must be set up in Pool Boss unless you turn on "auto add missing items".
|
|
waku
New Member
Posts: 7
Posts: 7
|
Post by waku on Sept 12, 2015 5:04:42 GMT
"auto add missing items" work fine, thank you once again for helping 
|
|
|
Post by DarkTonic Dev on Sept 12, 2015 5:14:11 GMT
No problem.
|
|