Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Sly on June 23, 2015, 10:18:44 AM

Title: Using an outside folder
Post by: Sly on June 23, 2015, 10:18:44 AM
Hello,

I'm wondering if it's possible to use an outside folder from project in playmaker.

For example, I want the user to be able to add picture in a folder, and playmaker will choose randomly a picture inside this folder. Is it possible?
Title: Re: Using an outside folder
Post by: FritsLyn on June 23, 2015, 03:06:20 PM
I'm not 100% sure I understand you - but if I do, then I think yo'd want to look into Unity's limitations, and how things (mostly) needs to be inside of the Assets folder.

As I understand you, this is not a PlayMaker related question, but a general Unity question.

Anyway, IF you have a folder that is acessible by Unity in Playtime, then surely, it's not a problem to have PlayMaker handle the rest..

I hope this helps you a little further ;)
Title: Re: Using an outside folder
Post by: Sly on June 23, 2015, 04:40:49 PM
It's both I guess. For sure yes, you're right, unity itself needs to handle "open folder" outside a project folder.

But for now I'm just wondering if Playmaker can take random item (like picture) from a folder.
For example, I want to choose a random picture from my folder and draw it on an in game object.
That's probably the thing I need to know on Playmaker side.

Thanks for your remark FritsLyn!
Title: Re: Using an outside folder
Post by: Lane on June 23, 2015, 04:53:21 PM
Yep, use the WWW action.

Look around for WWW info on Unity answers and such for information on giving it the correct path name so it looks on the drive.
Title: Re: Using an outside folder
Post by: Sly on June 25, 2015, 09:28:59 AM
Thanks Lane! I was thinking the www action was only use for url, but it make sense!

So basically the path needed should be the following:

OSX: "file:///Users/..."
Windows: "file:///c://Users/..."
Title: Re: Using an outside folder
Post by: Lane on June 25, 2015, 09:43:59 AM
Yeah, theres also built in shortcuts in windows/unity like %ApplicationPath% and others you can use to target specific folders like the current logged in user's photo folders etc, look into those. They're wrapped in % signs.