playMaker

Author Topic: Get "myself" [SOLVED]  (Read 2248 times)

TheBadFeeling

  • Junior Playmaker
  • **
  • Posts: 63
    • View Profile
Get "myself" [SOLVED]
« on: March 14, 2015, 07:10:37 AM »
Hey

Just wondering if there is any smart way to "get myself (GameObject)" -- that is, having a gameobject put itself into a GameObject variable.

There is no "use owner" on the Set GameObject action.

Right now, I have other objects tell my gameobject who it is -- or I use Find child and Find Parent in order to "find myself" -- and that's rather rediculous. :) There must be a better way.

/Bad

« Last Edit: March 22, 2015, 09:03:22 AM by TheBadFeeling »
The Force is with you, young Playmaker – but you are not a C# senpai yet.

redikann

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: Get "myself"
« Reply #1 on: March 14, 2015, 11:42:10 AM »
I believe what you want is the Get Owner Action.

wheretheidivides

  • Sr. Member
  • ****
  • Posts: 496
    • View Profile
Re: Get "myself"
« Reply #2 on: March 14, 2015, 12:02:55 PM »
I don't believe there is a 'owner' on this action.  You have to load the object inot a variable first.

Yes, actually you will need this a lot if using prefabs.  You'll need to be able to point to something.  On youtube they have a video tutorial about this on the playmaker channel.

You need to create a global variable.  In the global variable you link it to the object.  then in the state, you point the variables together.  See pictures.



Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2508
  • Mender of the past
    • View Profile
    • Cleverous
Re: Get "myself"
« Reply #3 on: March 14, 2015, 04:02:11 PM »
Hey

Just wondering if there is any smart way to "get myself (GameObject)" -- that is, having a gameobject put itself into a GameObject variable.

There is no "use owner" on the Set GameObject action.

Get Owner

Typically I do this on the Start state which is dedicated to Initializing things and store the owner as a GameObject called "me" for easy reference later in the FSM.

There isn't any need to Set Game Object as Owner because Get Owner does the exact same thing.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Get "myself"
« Reply #4 on: March 14, 2015, 05:44:48 PM »

Get Owner

Typically I do this on the Start state which is dedicated to Initializing things and store the owner as a GameObject called "me" for easy reference later in the FSM.

There isn't any need to Set Game Object as Owner because Get Owner does the exact same thing.

Tried Get Owner on a manager controlling a mechanical hand in order to pick up a another object/cube. Doesn't work on my end though. Same with Get Parent.

What does that mean though? I know I can't set up that action at the start state since that's needed in order to start up the machine. What should I do, when I need that FSM being independent of not only the hand but also the cube.

TheBadFeeling

  • Junior Playmaker
  • **
  • Posts: 63
    • View Profile
Re: Get "myself"
« Reply #5 on: March 22, 2015, 09:02:53 AM »
Good input, guys.
Get Owner was of course what I was looking for.  :D

Thanks a lot.
/Bad
The Force is with you, young Playmaker – but you are not a C# senpai yet.