Unity with browser communication problem

I’m trying to call a function in the Unity from browser.

<script type="text/javascript" language="javascript">
function getUserLogin(VOID)
GetUnity().SendMessage("LoginGui", "GetUserLogin1", "Hello from a web page!");

The project unit has LoginGui object, it has a component LoginGuiComponent, which has GetUserLogin1(string login) method. How can I call it from javascript? Example not work.

I’m having the same issue, I’m trying to call a method in :

public class GUICore {

public void ping() {




In the Web page javascrip :

function pong() {

console.log(‘ping pong’);


in the Chrome console I’m calling this :


This should call unity and unity should call back to the pong function typing ‘ping pong’ in the console window…
But nothing happens :confused:

This is a simple test, and I’ve looked at the documentation of unity.

Could someone please help us here.