Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: LordHorusNL on September 11, 2017, 07:14:36 PM

Title: Get Parent Multiple? Get parent of parent etc [SOLVED]
Post by: LordHorusNL on September 11, 2017, 07:14:36 PM
I would like to request a "Get Parent" action that allows me to not only get the parent of my game object but also allows me to define how far up the hierarchy chain i want to pick a parent. Get parent three times removed or something.

I have a game object that needs to be parented and unparented a lot and i want to be able to always choose the third parent up as my root object, without having to use 3 or more "Get Parent" actions. "Get Root" is useless in this situation.

Something like this:

Game Object  : Use Owner
Parent Level   : 3
Parent Object : -(Result)-

If that makes sense.
Title: Re: Get Parent Multiple? Get parent of parent etc
Post by: 600 on September 11, 2017, 07:28:36 PM
Hi, there is such action on Ecosystem called Get Parent More
Title: Re: Get Parent Multiple? Get parent of parent etc
Post by: LordHorusNL on September 11, 2017, 08:07:32 PM
I'm not finding it.

There are recursive actions, but noting to get objects up the chain that i can see.
Title: Re: Get Parent Multiple? Get parent of parent etc
Post by: 600 on September 11, 2017, 08:17:50 PM
For now I put in attachment until we find the source. Also have not tested with new versions.


Edit: Removed attached outdated action.
Title: Re: Get Parent Multiple? Get parent of parent etc
Post by: tcmeric on September 11, 2017, 10:56:24 PM
I wrote this one called "get parent with tag". It goes up until it finds the nearest parent with a specific tag. I just put a different tag on the parent i want to get.
Title: Re: Get Parent Multiple? Get parent of parent etc
Post by: LordHorusNL on September 12, 2017, 08:30:51 AM
You are both Gentlemen Extraordinaire!

*Update* the Get Parent More action resets to 0 after it has been used once, so i am unable to get the parent object multiple times.

Is there quick code fix to keep the settings through the entire session?
Title: Re: Get Parent Multiple? Get parent of parent etc
Post by: LordHorusNL on September 13, 2017, 10:43:37 AM
*Bump*

Anybody know how to stop the script from resetting?
Title: Re: Get Parent Multiple? Get parent of parent etc
Post by: djaydino on September 13, 2017, 10:08:55 PM
Hi,
Updated the action and placed it on the Ecosystem.
Let me know if it works now :)
Title: Re: Get Parent Multiple? Get parent of parent etc
Post by: LordHorusNL on September 14, 2017, 09:29:25 AM
The actions works perfectly! Very much appreciated.

Thanks djaydino