playMaker

Author Topic: Can't reference prefabs?  (Read 954 times)

fromfame

  • Junior Playmaker
  • **
  • Posts: 78
  • Sloppy PM Veteran
Can't reference prefabs?
« 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?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Can't reference prefabs?
« Reply #1 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)