playMaker

Author Topic: Find last GO in the hierarchy?  (Read 264 times)

kavery

  • Full Member
  • ***
  • Posts: 117
    • View Profile
Find last GO in the hierarchy?
« on: November 27, 2019, 03:00:16 PM »
I'm using the OBJ importer at runtime. It's a little awkward turning the imported OBJ into a GO variable, in order to access it with PM.

Since it appears last in the hierarchy upon import, that's one way I could find it. Is there a way to find last GO in the hierarchy?

Currently I figured a way involving find any object with "xx" somewhere in the name. But I'd rather not rely on having to put some unusual tag into every imported file name. It's a more expensive process as well.   

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 165
    • View Profile
Re: Find last GO in the hierarchy?
« Reply #1 on: November 28, 2019, 08:35:56 AM »
I'm not sure i follow but wouldn't "Get Last Child" from the ecosystem do the trick?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
  • Official Playmaker Support
    • View Profile
Re: Find last GO in the hierarchy?
« Reply #2 on: November 29, 2019, 06:48:24 AM »
hi,

 can you reference the obj imported you are using, I can certainly see if I can make a quick custom action for this.

Bye,

 Jean

kavery

  • Full Member
  • ***
  • Posts: 117
    • View Profile
Re: Find last GO in the hierarchy?
« Reply #3 on: December 02, 2019, 11:39:16 AM »
@LordHorusNL  thanks, but that only works for children of another game object. I meant the global hierarchy.

@JeanFabre that would be totally awesome. It's the free DUMMIESMAN Runtime OBJ Importer.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
  • Official Playmaker Support
    • View Profile
Re: Find last GO in the hierarchy?
« Reply #4 on: December 03, 2019, 12:56:08 AM »
Hi,

 ok, try the actions attached to this message, I'll contact the author, maybe he can add them directly to the package on the asset store, else I'll put them in the misc rep of the Ecosystem.

LoadObjFromWWW
LoadObjFromFile

Let me know how it goes, I tested both.


Bye,

 Jean

kavery

  • Full Member
  • ***
  • Posts: 117
    • View Profile
Re: Find last GO in the hierarchy?
« Reply #5 on: December 06, 2019, 01:30:22 PM »
This is excellent. Much better than what I was seeking. It works with shortened local paths too. Thanks for adding that!

Wondering if there's a way to get an array of strings, to make a list of obj files from a path/folder .. so that in the PC app somebody can drop a bunch of .objs into the build folder, and select them from a menu, rather than have to type in the name of the file.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 14819
  • Official Playmaker Support
    • View Profile
Re: Find last GO in the hierarchy?
« Reply #6 on: December 12, 2019, 05:15:52 AM »
Hi,

uhm, for this you might be better off using a proper selection window UI system like:

https://assetstore.unity.com/packages/tools/utilities/file-browser-free-98716

and it has playmaker support

Bye,

 Jean