Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Text Copied to Clipboard Doesn't Come Outside the Game

Discussion in 'UI Toolkit' started by bakoti, May 1, 2020.

  1. bakoti

    bakoti

    Joined:
    Apr 2, 2020
    Posts:
    2
    When I build the game for WebGL and copy a text, whether directly to systemCopyBuffer or from an Input Field, I can only paste the text inside the game. If I try to paste it to a notepad for example it doesn't work. But it works when I run the game in editor. How can I fix this?
     
  2. DonLoquacious

    DonLoquacious

    Joined:
    Feb 24, 2013
    Posts:
    1,667
    This isn't really a UI Toolkit issue, it's a WebGL security feature IIRC. I believe in order to copy from a WebGL app to your system's clipboard you'd need to use a Javascript library or something to bridge that gap.

    Google for "Unity WebGL copy to windows clipboard" or something, and you'll find a few workarounds.
     
unityunity