playMaker

Author Topic: Get Parent Multiple? Get parent of parent etc [SOLVED]  (Read 242 times)

LordHorusNL

  • Junior Playmaker
  • **
  • Posts: 78
    • View Profile
Get Parent Multiple? Get parent of parent etc [SOLVED]
« on: September 11, 2017, 04: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.
« Last Edit: September 14, 2017, 06:29:42 AM by LordHorusNL »

600

  • Sr. Member
  • ****
  • Posts: 494
    • View Profile
    • Car and Traffic Playmaker assets
Re: Get Parent Multiple? Get parent of parent etc
« Reply #1 on: September 11, 2017, 04:28:36 PM »
Hi, there is such action on Ecosystem called Get Parent More

LordHorusNL

  • Junior Playmaker
  • **
  • Posts: 78
    • View Profile
Re: Get Parent Multiple? Get parent of parent etc
« Reply #2 on: September 11, 2017, 05:07:32 PM »
I'm not finding it.

There are recursive actions, but noting to get objects up the chain that i can see.

600

  • Sr. Member
  • ****
  • Posts: 494
    • View Profile
    • Car and Traffic Playmaker assets
Re: Get Parent Multiple? Get parent of parent etc
« Reply #3 on: September 11, 2017, 05:17:50 PM »
For now I put in attachment until we find the source. Also have not tested with new versions.

tcmeric

  • Sr. Member
  • ****
  • Posts: 480
    • View Profile
Re: Get Parent Multiple? Get parent of parent etc
« Reply #4 on: September 11, 2017, 07: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.

LordHorusNL

  • Junior Playmaker
  • **
  • Posts: 78
    • View Profile
Re: Get Parent Multiple? Get parent of parent etc
« Reply #5 on: September 12, 2017, 05: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?
« Last Edit: September 12, 2017, 09:32:05 AM by LordHorusNL »

LordHorusNL

  • Junior Playmaker
  • **
  • Posts: 78
    • View Profile
Re: Get Parent Multiple? Get parent of parent etc
« Reply #6 on: September 13, 2017, 07:43:37 AM »
*Bump*

Anybody know how to stop the script from resetting?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2288
    • View Profile
    • jinxtergames
Re: Get Parent Multiple? Get parent of parent etc
« Reply #7 on: September 13, 2017, 07:08:55 PM »
Hi,
Updated the action and placed it on the Ecosystem.
Let me know if it works now :)

LordHorusNL

  • Junior Playmaker
  • **
  • Posts: 78
    • View Profile
Re: Get Parent Multiple? Get parent of parent etc
« Reply #8 on: September 14, 2017, 06:29:25 AM »
The actions works perfectly! Very much appreciated.

Thanks djaydino