Playmaker Forum

PlayMaker Updates & Downloads => Share New Actions => Topic started by: Lane on May 13, 2014, 09:53:06 AM

Title: WWW Object Relative
Post by: Lane on May 13, 2014, 09:53:06 AM
It's the WWWObject action with the addition of...


The exported build has a Data folder, "relative" is considered root inside that folder, so if you go to the folder with the exe, you'll see Data... inside that is where the path is looking.

This should work exactly the same as the original WWWObject action with the exception that you can store audio and define pathing as relative.

Example path would be (minus quotes)... "CustomStuff/BobsSpecialSound.wav"

code snippet:
...note that the first frontslash is included, so its not needed in the action's "url" spot.
Code: [Select]
urlPrefix = "file://"+Application.dataPath+"/";
...
...
if (pathIsRelative.Value = true)
{
wwwObject = new WWW(urlPrefix+url.Value);
}
Title: Re: WWW Object Relative
Post by: Slater on May 27, 2014, 08:52:30 AM
When I install this it doesn't show up in the action browser.
Title: Re: WWW Object Relative
Post by: Lane on May 27, 2014, 09:00:41 AM
Do you have any compile errors?
Title: Re: WWW Object Relative
Post by: Slater on May 27, 2014, 09:12:33 AM
No, only deprecated playmaker stuff in console. Tried to install it from the Ecosystem first and it didn't show up in the action browser. Deleted it restarted Unity and then tried installing it from this download instead, but still no luck. I am running Unity 3d v4.3.4f1 and Playmaker 1.7.7F6
Title: Re: WWW Object Relative
Post by: jeanfabre on May 29, 2014, 01:55:55 AM
Hi,

 Is the action green in the ecosystem listing? Are you sure Unity is not firing an error? Playmaker won't process anything if Unity has an error.

Bye,

 Jean
Title: Re: WWW Object Relative
Post by: Slater on May 29, 2014, 07:55:36 AM
No errors. It says that it compiles, Playmaker gets grey and then it reloads and still nothing. I am able to add other add-ons.
Title: Re: WWW Object Relative
Post by: Lane on May 29, 2014, 08:38:58 AM
The WWW actions are excluded for mobile builds.
Title: Re: WWW Object Relative
Post by: Slater on May 29, 2014, 09:31:30 AM
Ohh, I was suggested to use this instead of WWW POST Mobile in order to make use of Audio. Hmm.
Title: Re: WWW Object Relative
Post by: Lane on May 29, 2014, 09:37:42 AM
This was based on the WWW Object action (stock) which excludes mobile so I kept those exclusions in the Relative version. I'm not sure why they are actually in place, I don't have an iPhone to test on.
Title: Re: WWW Object Relative
Post by: 600 on November 21, 2022, 01:05:44 PM
Hello Lane,

Thank you for the action, I'm using it to get Audio Clip files.

Every now and then I get an error in Editor from this action, the original WWW action don't have this:

Code: [Select]
UnityException: get_dataPath can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.

Unity 2019.4, I got the action from Ecosystem.

Any ideas? Thanks!
Title: Re: WWW Object Relative
Post by: djaydino on November 24, 2022, 09:38:55 AM
Hi.
I fixed the issue (attachment below)
Title: Re: WWW Object Relative
Post by: 600 on November 25, 2022, 06:02:59 AM
Hi.
I fixed the issue (attachment below)
Thank you!