SecurityException: This method is not supported in the unity web player for security reasons.

I get this error when trying to use UnityEditor.AssetDatabase.CreateAsset(UnityEngine.Object, string) in my game’s source code.

unity security internal call - throwing exception
SecurityException: This method is not supported in the unity web player for security reasons.
AssetLoader.Load (System.String path, System.Type type)

I’m wondering if there’s any way to get around this?

there are a lot of disadvantages if you want to build for flash or webplayers cause its blocked by windows firewall. disavantages include writing to a players hardrive. the operating system blocks it just like any other website script. if your game requires saving data, you have to change build settings to make a standalone player.