1
\$\begingroup\$

I would like to know if there is a solution to copy/paste the text from/to an InputField in a WebGL Unity app.

For security reasons, Unity WebGL doesn't allow text copy and paste in/from browser.

\$\endgroup\$
5

1 Answer 1

1
\$\begingroup\$

I don't know if this works well but an attempt at a solution is to use the browser's copy and paste events. In paste pass that into Unity and append to the current InputField. On copy ask the inputfield to copy then pass unity's clipboard back to the browser

Here's some code and a working example

https://github.com/greggman/unity-webgl-copy-and-paste

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .