Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: westingtyler on March 08, 2017, 12:05:46 AM

Title: "Find Closest Parent (up the chain) with tag/name X"?
Post by: westingtyler on March 08, 2017, 12:05:46 AM
Rather than adding a thousand loops and get parent and check tag commands, it would be great to have this. So when I shoot someone's hand, it can go up the chain and find out the name of the person it belongs to, for instance.
Title: Re: "Find Closest Parent (up the chain) with tag/name X"?
Post by: jeanfabre on March 13, 2017, 02:14:56 AM
Hi,

 Have you tried "Get Root", it's likely what you need. Else I'll do a custom action.

 Bye,

 Jean
Title: Re: "Find Closest Parent (up the chain) with tag/name X"?
Post by: beowulfkaine on July 09, 2017, 05:17:08 PM
Hi,

 Have you tried "Get Root", it's likely what you need. Else I'll do a custom action.

 Bye,

 Jean

Thank you so much for the suggestion. Although what you mentioned didn't exactly work (though it did literally do what it was meant to do) I had a nested gameobject within a game object:

Arrow
Misc (folder)
Arrows-->
     ->Base Arrow
          ->Arrow Prop
     ->Ice Arrow
          ->Arrow Prop

So the get parent got the parent of the immediate folder.  So it did what it was suppose to, but I needed to get the Root parent. This is because when the arrow is fired, the parent tag determines what effect the target displays. (Ice Arrow = Ice effect on target) ect..

So although your method may have not worked, it definitely put me on the path to discovering how to use "Get (whatever) action.  Which led me to do a down and dirty mod to do it.  I don't know if there is an action that makes this easier than the way I did it, but this is what I have done:

(https://image.ibb.co/d2qhUa/1.png)

(https://image.ibb.co/jVBd2v/2.png)

I don't know if there is a n easier way or maybe an action that streamlines all this, but this seems to work pretty good.

Oh and I should mention, the arrow objects within the gameobject are enabled and disabled on command, thus starting the FSM that turns the tag to whatever arrow it is.