playMaker

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

johnmadden

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Game Object Compare?
« on: October 13, 2017, 10:48:48 PM »
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 13, 2017, 10:53:59 PM by johnmadden »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 3921
    • View Profile
    • jinxtergames
Re: Game Object Compare?
« Reply #1 on: October 13, 2017, 11:15:12 PM »
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.

krmko

  • Beta Group
  • Hero Member
  • *
  • Posts: 899
    • View Profile
    • Fat Pug Studio
Re: Game Object Compare?
« Reply #2 on: October 14, 2017, 01: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, 11:00:03 AM by krmko »