playMaker

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

fromfame

  • Junior Playmaker
  • **
  • Posts: 65
  • Sloppy PM Veteran
    • View Profile
Can't reference prefabs?
« on: March 18, 2019, 03: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: 4706
    • View Profile
    • jinxtergames
Re: Can't reference prefabs?
« Reply #1 on: March 18, 2019, 07: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)