Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by LRG · Jul 14, 2015 at 12:33 PM · script.webgllanguagetechnicalembedding

Embedding scripting language (webgl-compatible)

Is there currently any scripting language that can be embedded into Unity, and still work when the project is exported to WebGL?

So far I have tried quite a few, but no luck. Many require the ability to dynamically generate IL code (which isn't available in WebGL).

The most "promising" one I tried was probably MoonSharp, but no luck either. There seems to be no hard technical limitation, but, scripts always fail to run due to some unknown problems.

(Other languages such as IronPython I haven't tried because I believe that they just can't work due to the IL generation issue).

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by mgear · Feb 26, 2017 at 10:11 AM

Latest Moonsharp works with webgl (older versions apparently had problems)

Have tested it with Moonsharp 2.0 and Unity 5.5.1p3 webgl (tested the factorial sample and FungusLuaUtils)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by gfoot · Oct 02, 2015 at 10:25 AM

The simplest option for WebGL is to use Javascript itself, executing within the browser. You can load and run scripts dynamically by asking the browser to evaluate them, and with an appropriate jslib you can call arbitrary Javascript functions and - with care - the Javascript can also call your compiled C# methods (e.g. so you can provide entry points for the scripts to interact with your game engine).

I am interested in developing a plugin for this, so if you want to talk about your needs privately then please feel free to message me!

However this would only work in WebGL builds where we can lean on the browser to execute the scirpts. For the editor and other platforms it would require a dedicate Javascript interpreter - I think there are some already on the asset store but compatibility might need some care.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Schubkraft · Jul 27, 2015 at 10:18 AM

WebGL supports only supports AOT and no threading.

Have you looked at https://www.assetstore.unity3d.com/en/#!/content/645 or something similar? No idea if that works with WebGL but still might be a good start for you.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image LRG · Jul 27, 2015 at 04:44 PM 0
Share

I don't think it can work :( That plugin seems to be based in IronPython, which I'm pretty sure generates code dynamically.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

24 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Embedded standalone application in Qt window: communication and automatic resize 1 Answer

Is it possible to embed a YouTube video in Unity's WebGL build? 1 Answer

Embed Unity Webgl game to wix website 1 Answer

Loading Scripts from asset bundle in iOS and WebGL. 0 Answers

How to embed WebGL game on a website? 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges