playMaker

Author Topic: Setting Global GameObjects  (Read 2810 times)

iEpic

  • Playmaker Newbie
  • *
  • Posts: 48
    • IndieGamerWorld
Setting Global GameObjects
« on: February 05, 2015, 05:08:22 AM »
I'm having to set a lot of my gameobjects to playmaker global gameobjects, and I was wondering how I could set a global gameobject that is disabled.

For example...
I have a game object I want to start deactivated, but need the get owner to save it as a global gameobject. It won't save it if it starts off deactivated.

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: Setting Global GameObjects
« Reply #1 on: February 05, 2015, 07:18:30 AM »
you may use find gameObject by name for exemple at the begginning of the scene

iEpic

  • Playmaker Newbie
  • *
  • Posts: 48
    • IndieGamerWorld
Re: Setting Global GameObjects
« Reply #2 on: February 05, 2015, 07:19:40 AM »
I thought it was bad to use find gameobject??

Remember reading that somewhere a long time ago thats why I never used it.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Setting Global GameObjects
« Reply #3 on: February 05, 2015, 07:26:02 AM »
Its not a forbidden action or something, its just cautiously used because if used too much in a mid - large scene it can cause performance issues. For instance in the middle of a game you're still using Find GameObject on every new creature that spawns to find some database or whatever, that will likely affect performance adversely.

You can definitely use a proxy of some sort to host your variables, but this is something you want to think about and find a good way that will work for your game when it comes to intercommunication between entities, managing persistent data, database retrieval, etc...
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

iEpic

  • Playmaker Newbie
  • *
  • Posts: 48
    • IndieGamerWorld
Re: Setting Global GameObjects
« Reply #4 on: February 05, 2015, 07:28:52 AM »
So doing find gameobject when the scene loads will be fine as long as it's not used a bunch of times.
How many times are we talking about?
Can I use it on 50 game objects and it will be fine, as long as it's at the beginning??
Thanks for your help BTW I really do appreciate it

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Setting Global GameObjects
« Reply #5 on: February 05, 2015, 07:34:02 AM »
Yeah typically you want to put heavy stuff like that at the start of the scene so you can hide the process behind a Loading Bar or something and the user won't see the performance hit during the middle of the game.

It's all about experimentation and depends on how slow it really is in your game for you to decide what to do.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

iEpic

  • Playmaker Newbie
  • *
  • Posts: 48
    • IndieGamerWorld
Re: Setting Global GameObjects
« Reply #6 on: February 05, 2015, 07:35:02 AM »
Awesome!!

Thanks so much for your help!