Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

WebGL and eval()

Discussion in 'Scripting' started by dansav, Mar 2, 2015.

  1. dansav

    dansav

    Joined:
    Sep 22, 2005
    Posts:
    499
    Will WebGL support eval(). I was reading that the unity code will be converted to javascript and javascript does support eval.

    Can the javascript that I write on an html page be aware or see any javascript variables in unity? Or would I have to use the standard SendMessage and ExternalEval to communicate back and forth.
     
  2. sokki

    sokki

    Joined:
    Jan 31, 2015
    Posts:
    166
    off-topic, have you made any Webgl game by far?
     
  3. ornicar

    ornicar

    Joined:
    Mar 17, 2015
    Posts:
    6
    As far as I understand, eval() is not supported by Unity WebGL build.

    Applicaton.ExternalEval() is supported but the evaluated code does not have access to variables inside Unity. Or at least I don't know how to.