Playmaker Forum
PlayMaker Updates & Downloads => Share New Actions => Topic started by: Lane on May 13, 2014, 09:53:06 AM
-
It's the WWWObject action with the addition of...
- Able to store AudioClip objects from file
- Able to choose a Relative Path option (local to the build's data folder) via bool
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.
urlPrefix = "file://"+Application.dataPath+"/";
...
...
if (pathIsRelative.Value = true)
{
wwwObject = new WWW(urlPrefix+url.Value);
}
-
When I install this it doesn't show up in the action browser.
-
Do you have any compile errors?
-
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
-
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
-
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.
-
The WWW actions are excluded for mobile builds.
-
Ohh, I was suggested to use this instead of WWW POST Mobile in order to make use of Audio. Hmm.
-
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.
-
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:
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!
-
Hi.
I fixed the issue (attachment below)
-
Hi.
I fixed the issue (attachment below)
Thank you!