Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: kavery on November 27, 2019, 05:00:16 PM

Title: Find last GO in the hierarchy?
Post by: kavery 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.   
Title: Re: Find last GO in the hierarchy?
Post by: LordHorusNL 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?
Title: Re: Find last GO in the hierarchy?
Post by: jeanfabre 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
Title: Re: Find last GO in the hierarchy?
Post by: kavery 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.
Title: Re: Find last GO in the hierarchy?
Post by: jeanfabre 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
Title: Re: Find last GO in the hierarchy?
Post by: kavery 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.

Title: Re: Find last GO in the hierarchy?
Post by: jeanfabre 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