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. Dismiss Notice

[WebGL] Programming courses using Unity games and Blockly

Discussion in 'Made With Unity' started by seldom, Mar 17, 2018.

  1. seldom

    seldom

    Joined:
    Dec 4, 2013
    Posts:
    118
    Hello,

    we are developing programming courses for children. They use the visual language Blockly, similar to projects like Scratch, Tinker or code.org. What is new about our system is that the code runs in Unity games. Basically our users are modding games.

    The first course is now available, for free. If you have kids or at least have an inner child, give it a try and let us know what you think.
     
  2. Tommy0814

    Tommy0814

    Joined:
    Jul 20, 2017
    Posts:
    2
    Hello, can you briefly tell me how did you integrate Google Blockly with Unity3d?
     
  3. seldom

    seldom

    Joined:
    Dec 4, 2013
    Posts:
    118
    Sure. For starters, create a html page with two canvas elements. One contains a blockly workspace, the other one contains a WebGL build of your Unity project. Then you need custom blocks that generate code like this. Specifically, use SendMessage() to call into the unity game. Then you use your new custom blocks, let blockly convert them to JavaScript and eval() the script, at which point the game gets those messages.
    Thats the overview, I hope it helps.