playMaker

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

kavery

  • Full Member
  • ***
  • Posts: 149
Find last GO in the hierarchy?
« on: November 27, 2019, 05: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: 226
Re: Find last GO in the hierarchy?
« Reply #1 on: November 28, 2019, 10: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: 15500
  • Official Playmaker Support
Re: Find last GO in the hierarchy?
« Reply #2 on: November 29, 2019, 08: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: 149
Re: Find last GO in the hierarchy?
« Reply #3 on: December 02, 2019, 01:39:16 PM »
@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: 15500
  • Official Playmaker Support
Re: Find last GO in the hierarchy?
« Reply #4 on: December 03, 2019, 02: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: 149
Re: Find last GO in the hierarchy?
« Reply #5 on: December 06, 2019, 03: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: 15500
  • Official Playmaker Support
Re: Find last GO in the hierarchy?
« Reply #6 on: December 12, 2019, 07: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