playMaker

Author Topic: Game Object Compare?  (Read 3348 times)

johnmadden

  • Playmaker Newbie
  • *
  • Posts: 1
Game Object Compare?
« on: October 14, 2017, 01:48:48 AM »
I'm making a gun and I have a Game Object Compare function on my FSM and I would like it to compare the current object (magazine) to another exact copy of the magazine and it says they're not equal when they're the exact same prefab. When I use the find child by name action it also doesn't recognize the object despite the name being correct.


Also I'm trying to send a Game Object variable to the parent, how would I do that?
« Last Edit: October 14, 2017, 01:53:59 AM by johnmadden »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Game Object Compare?
« Reply #1 on: October 14, 2017, 02:15:12 AM »
Hi,
Actually it is not exactly the same object as it is a 'copy' from the object.

You can use "GameObject Compare Tag" and setup tags on your objects.

To get/set variables on other objects you can use get/set FSM actions.

if you need to find the parent 1st you can use get parent.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Game Object Compare?
« Reply #2 on: October 14, 2017, 04:15:16 AM »
GameObject =/= GameObject (1) if that's what you're aiming at. However, if you child two same objects under the magazines they will retain their names, so you can compare them if you want to do it by comparing objects, but there are better ways as djaydino noted.
« Last Edit: October 14, 2017, 02:00:03 PM by krmko »
Available for Playmaker work