playMaker

Author Topic: [Solved] Comparing GameObjects  (Read 3905 times)

AizenSousuke

  • Playmaker Newbie
  • *
  • Posts: 10
[Solved] Comparing GameObjects
« on: September 07, 2014, 02:37:24 AM »
Hi

I'm trying to compare the owner gameobject to filter which state to run as shown in the attachment. However, the action doesn't return true; only false. Does compare game objects work on prefabs?
« Last Edit: September 10, 2014, 09:42:16 AM by AizenSousuke »

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Comparing GameObjects
« Reply #1 on: September 07, 2014, 02:45:24 AM »
I don't believe it works with prefabs like that, a work around is to compare the gameobject name rather than the actual gameobject.

AizenSousuke

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Comparing GameObjects
« Reply #2 on: September 07, 2014, 02:55:22 AM »
I don't believe it works with prefabs like that, a work around is to compare the gameobject name rather than the actual gameobject.

There isn't an action for that... :/

Neoisrael

  • Playmaker Newbie
  • *
  • Posts: 34
Re: Comparing GameObjects
« Reply #3 on: September 07, 2014, 10:25:06 AM »
Hmm action for what ? Get the name ? Sure there is
Get propertry from the object and select name...

If u need any help send me a pm

TheBadFeeling

  • Junior Playmaker
  • **
  • Posts: 66
Re: Comparing GameObjects
« Reply #4 on: September 07, 2014, 11:55:29 AM »
You can use Find Gameobject to locate the object in the running scene and put it in a gameObj variable. Then reference the variable instead when you compare.
The Force is with you, young Playmaker – but you are not a C# senpai yet.

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Comparing GameObjects
« Reply #5 on: September 07, 2014, 07:10:22 PM »
Get name action does what you're after, use it in conjunction with a get owner action and store the gameobject as a variable (the get name doesn't have an owner option). I would avoid find at all costs.
« Last Edit: September 07, 2014, 07:19:12 PM by LampRabbit »

jess84

  • Hero Member
  • *****
  • Posts: 515
Re: Comparing GameObjects
« Reply #6 on: September 07, 2014, 10:46:03 PM »
Use the custom 'Get Name 2' from here: http://hutonggames.com/playmakerforum/index.php?topic=6848.0

... this one allows you to set Owner as self.
« Last Edit: September 07, 2014, 10:48:08 PM by jess84 »

AizenSousuke

  • Playmaker Newbie
  • *
  • Posts: 10
Re: Comparing GameObjects
« Reply #7 on: September 10, 2014, 09:39:38 AM »
Thanks all.. I guess that did the trick.