Skip to content

ReferenceError #27

@MichaelRazum

Description

@MichaelRazum

Hello,

I'm trying to setup a project using react unity. I have created a build using unity and copied the files in my public folder. Using this code in App.js:

import React, { Component } from 'react';
import './App.css';
import Unity from 'react-unity-webgl';

class App extends Component {
  render() {
    return (
        <Unity
          src='public/buildunity/build2.json'
          loader='public/buildunity/UnityLoader.js' />
    )
  }
}
export default App;


I'm getting the error in the browser:  "(in promise) ReferenceError: UnityLoader is not defined"
Any Idea what might be wrong?
Maybe I made a mistake. The react project was created with "create-react-app". 
Thanks a lot!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions