Search code examples
airconsole

Unity file 404 errors when running virtual controllers


I currently have the file structure below in my assets folder in Unity. ├───AirConsole │ ├───examples │ │ ├───basic │ │ │ └───Materials │ │ └───pong │ │ ├───materials │ │ ├───scripts │ │ └───sprites │ ├───extras │ ├───plugins │ │ ├───Android │ │ ├───iOS │ │ ├───Newtonsoft.Json │ │ │ ├───Bson │ │ │ ├───Converters │ │ │ ├───Linq │ │ │ ├───Schema │ │ │ ├───Serialization │ │ │ └───Utilities │ │ └───x86_64 │ │ └───WebView.bundle │ │ └───Contents │ │ ├───MacOS │ │ └───Resources │ ├───resources │ └───scripts │ └───editor └───WebPlayerTemplates |---controller.html ├───airconsole-controls │ ├───button │ ├───ctrl-generator │ ├───dpad │ ├───examples │ ├───joystick │ ├───rate-limiter │ ├───shake-detecor │ ├───swipe-analog │ ├───swipe-digital │ └───swipe-pattern ├───controller │ ├───js │ ├───libs │ ├───styles │ └───templates └───__MACOSX └───controller ├───js ├───libs ├───styles └───templates When I start the unity project, I get 404 errors for the following requests. GET http://192.168.56.1:7842/airconsole-controls/button/button.css controller.html:10 GET http://192.168.56.1:7842/airconsole-controls/dpad/dpad.css controller.html:12 GET http://192.168.56.1:7842/controller/styles/styles.css controller.html:13 GET http://192.168.56.1:7842/controller/styles/controls.css controller.html:56 GET http://192.168.56.1:7842/controller/libs/handlebars-v4.0.5.js controller.html:59 GET http://192.168.56.1:7842/controller/libs/airconsole_view_manager.js controller.html:62 GET http://192.168.56.1:7842/airconsole-controls/dpad/dpad.js controller.html:66 GET http://192.168.56.1:7842/controller/js/controller_generator.js controller.html:61 GET http://192.168.56.1:7842/airconsole-controls/button/button.js controller.html:64 GET http://192.168.56.1:7842/airconsole-controls/swipe-digital/swipe-digital.js controller.html:63 GET http://192.168.56.1:7842/airconsole-controls/swipe-analog/swipe-analog.js controller.html:67 GET http://192.168.56.1:7842/controller/js/main.js Do I have a misunderstanding on how I should structure my project so that airconsole can find the proper files? or am I missing projects. I am on version 1.6. Also the controller.html file is sitting inside the WebPlayerTemplates. I have all of the airconsole client side stuff in that folder because if I dont I get about 100 compile errors due to syntax.


Solution

  • As far as I know the files used by your controller.html have to be in the folder: Assets/WebGLTemplates/AirConsole

    The Unity guide is a great place to start

    Or you can just download the free project from the asset store and play around with it.

    Also something that caught us out: don't put your custom controller.html file you want to use in Assets/WebGLTemplates/AirConsole, this controller.html is overwritten by the Airconsole object. Rather put your controller.html file elsewhere and drag it onto the "Controller Html" property in the inspector of the Airconsole object.