playMaker

Author Topic: How do I activate a gameObject from a prefab?  (Read 2738 times)

grimmy

  • Junior Playmaker
  • **
  • Posts: 70
How do I activate a gameObject from a prefab?
« on: April 23, 2014, 07:47:41 AM »
I can't for the life of me figure this out. I've tried doing a 'Find' with another gameobject and then storing that as a global variable..but then I still get the reference error when I do this.

So, how can I activate an object from a prefab?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How do I activate a gameObject from a prefab?
« Reply #1 on: April 23, 2014, 09:57:33 AM »
Once you store the gameobject just use the Activate Game Object action.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

grimmy

  • Junior Playmaker
  • **
  • Posts: 70
Re: How do I activate a gameObject from a prefab?
« Reply #2 on: April 24, 2014, 01:37:34 AM »
This works but I have an setup error on my prefab which wont ever go away telling be that I shouldn't reference scene objects.

Should I just ignore the error?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How do I activate a gameObject from a prefab?
« Reply #3 on: April 24, 2014, 06:37:03 AM »
You have to create the object in the scene first. objects in the project hierarchy don't exist yet and therefore can't do anything to affect the scene.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D