playMaker

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

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Get Parent Multiple? Get parent of parent etc [SOLVED]
« 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.
« Last Edit: September 14, 2017, 09:29:42 AM by LordHorusNL »

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: Get Parent Multiple? Get parent of parent etc
« Reply #1 on: September 11, 2017, 07:28:36 PM »
Hi, there is such action on Ecosystem called Get Parent More

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Get Parent Multiple? Get parent of parent etc
« Reply #2 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.

600

  • Beta Group
  • Hero Member
  • *
  • Posts: 713
    • Flashing Lights
Re: Get Parent Multiple? Get parent of parent etc
« Reply #3 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.
« Last Edit: January 10, 2018, 10:14:23 AM by 600 »

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: Get Parent Multiple? Get parent of parent etc
« Reply #4 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.

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Get Parent Multiple? Get parent of parent etc
« Reply #5 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?
« Last Edit: September 12, 2017, 12:32:05 PM by LordHorusNL »

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Get Parent Multiple? Get parent of parent etc
« Reply #6 on: September 13, 2017, 10:43:37 AM »
*Bump*

Anybody know how to stop the script from resetting?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Get Parent Multiple? Get parent of parent etc
« Reply #7 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 :)

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Get Parent Multiple? Get parent of parent etc
« Reply #8 on: September 14, 2017, 09:29:25 AM »
The actions works perfectly! Very much appreciated.

Thanks djaydino