Copy Text on Button Press (Windows EXE Build)

I’m trying to implement a Copy Button to copy the text information in a UI text box. Thought i’d found a solution with to following code:

EditorGUIUtility.systemCopyBuffer = myText.text;

However, once I tried building the .exe, it turns out this can only be used in the Unity Editor and EditorGUIUtility doesn’t exist outside of it.

I’ve read that WebGL builds of Unity have a lot of security issues with Copy/Paste - would this be affecting an .exe build?

Any solutions to this would really be appreciated!

There’s a non-editor version as well!

1 Like