Search Unity

ASP.NET + Angular + WebGL problem

Discussion in 'Scripting' started by anton13395, Sep 1, 2019.

  1. anton13395

    anton13395

    Joined:
    Dec 18, 2018
    Posts:
    1
    Hi, i tried to insert unity player into angular component but when i try to load the page i have this error:

    Invoking error handler due to
    SyntaxError: expected expression, got keyword 'var'
    ERROR TypeError: "UnityLoader[id] is not a function"

    but in the Networking tab i have all the *.unityweb loaded correctly

    i'm using unity-loader angular package like this:

    import { UnityLoader } from 'unity-loader'

    export class GameComponent implements AfterViewInit {
    unityInstance: any

    constructor() { }

    ngAfterViewInit() {
    var unityInstance = UnityLoader.instantiate("unityContainer", "Build/HTML5.json");

    }
    }