Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: fromfame on March 18, 2019, 06:06:23 AM

Title: Can't reference prefabs?
Post by: fromfame on March 18, 2019, 06:06:23 AM
I'm pooling prefabs, whenever I spawn a prefab I can't find a way to set/get their properties.

Any ideas?
Title: Re: Can't reference prefabs?
Post by: djaydino on March 18, 2019, 10:55:47 AM
Hi.

How are you pooling them?

With the pooler actions or another asset?

If pooler :
It has a 'store Object', where you can set a variable to store the spawned  object.

Then you can use 'Set FSM' actions to set some data to the prefab, using that variable.
If the prefab needs to reference to objects(and object fsms) , i use game object variables on the prefab and set the game objects to correspond to.
The same way as above. (Set Fsm GameObject)

Then where needed in the prefab, reference to that varaible(s)