Experimental support for Unity native audio plugins on the develop branch


@daniel I am familiar with git and I was able to download that repository using the line of code you suggested. However, when I create a plugin with this version of JUCE in the Projucer, I don’t see an option to enable Unity. Do you know why that might be?


You need to build the projucer yourself, it’s in JUCE/extras


Thanks. That got it to show up.


Is it possible, using this experimental appraoch, to get unity’s transformation matrix (x,y,z & rotaion & scale) into the plugin?


No the Unity plug-in API doesn’t provide this. You could expose parameters for these values and modify them from a Unity script though.


@ed95 Nice work with this.

One thing I’ve noticed is a small bug for plugins with spaces in their names. For example with a plugin called “My Plugin”, a class called audioplugin_My PluginGUI will be created in the UnityScript.cs. This causes custom GUI loading to fail. I think whatever is generating the .cs file needs to sanitise the name string, removing spaces (or any other characters not allowed in a class name).



I’ll get that sorted out, thanks!


@ed95 I found out by accident that juce_Unity_Wrapper.cpp doesn’t compile with Visual Studio 2017 (I haven’t tried another version of VS) when compiling for Win32. I made a PR with the fix:


Thank you, I’ll get this fixed.


Hi ed,

great to have support for Unity audio plugins. Thanks for putting in the work!

I’ve encountered a slight problem during code signing on macOS:

unsealed contents present in the bundle root
Command /usr/bin/codesign failed with exit code 1

this is because the .cs script is copied into the bundle root. This could be fixed by copying the script a little deeper by setting Subpath to ‘Contents/Scripts’:



PS.: or don’t copy the .cs file ? It seems I have to move it out of the bundle anyway for Unity to pick it up.


Are you sure? I haven’t experienced this being an issue before, Unity seems to do a recursive scan of the .bundle and picks up the script OK.

I’ll take a look at the code signing issue.


Unity doesn’t seem to recognise the plug-in when copying the GUI script to Contents/Scripts so after some testing it seems like the best place to copy it is the Resources section of the bundle - the code signing works correctly and the plug-in loads up in Unity.

I’ve pushed this here, you’ll need to re-build the Projucer after pulling and re-save your project.