Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to pass a parameter from web browser to Unity3D web player as soon as it is loaded. I know that, as soon as the web-player is loaded, the start() function is execute inside web-player. So I want to pass parameter from web browser to this start() function.

share|improve this question
Where exactly is the parameter coming from? The HTML code somewhere? HTML isn't going to "pass" anything, but perhaps Unity could retrieve it. If we know where you want to get it from, that would help. – Byte56 Jul 23 '13 at 21:54
up vote 3 down vote accepted

The documentation you need is here:

If you are able to control when you call Start(), eg. because that object isn't immediately created, then you can use the getUnity().SendMessage route to send in the parameters from the web page.

Otherwise, you might want to embed an Application.ExternalCall() into your Start() function to call out to a Javascript function in the web page, which can return the parameters you need.

share|improve this answer
Thank you very much... – Tharindu Jul 23 '13 at 22:23

This one was worked well. (then automatically read parameters from html page as soon as web-player is loaded, this method is good for read the URL parameters)

inside html->

function OnUnityReady()

    u.getUnity().SendMessage("GameObject", "myTest", GET.Use_id);

inside unity3D C# code ->

void Start()



share|improve this answer

I would rather consider using Application.srcValue which is the path to the web player data file relative to the html file (Read Only). Then you can attach a "?" with a parameter string.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.