Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TinyExport index.html files won't run without changing the file path...

Discussion in 'Project Tiny' started by Raspilicious, Dec 6, 2018.

  1. Raspilicious

    Raspilicious

    Joined:
    Jun 21, 2012
    Posts:
    24
    First I'd like to say it's so exciting playing around with Project Tiny. I was so happy when I saw the email in my inbox this morning!

    To my question: I've run through the YouTube playlist, following along and preparing the spacey-shootery game. I discovered when you press the Play button files are created in the project folders with the path of "[ProjectPath]/TinyExport/[Group Name]/html5/development/[The Files!]". In the development folder there's a /bin/ folder and in that an index.html. Double-clicking that file, I assume, should run the "built?" project in a browser. It doesn't - instead, a blank page welcomes me.

    Opening the file in my handy dandy notebook (ie Notepad) showed me the path (to what I am guessing is the main code) written as "/~project/TinyExport/SimpleInput/html5/development/ScriptAssemblies/tsc-emit.js".

    Changing that line to a path including "C:/[AddressOfTActualFolder]/TinyExport/SimpleInput/html5/development/ScriptAssemblies/tsc-emit.js" makes it run perfectly.

    I'm sure this is something that will be fixed soon (as Project Tiny has just been released this morning!), but I also would like to know if it's something I've done wrong in my build process, or if it's out of my hands and I'll have to edit my index.html file with each build for now.

    Thanks!
     
  2. raymondyunity

    raymondyunity

    Unity Technologies

    Joined:
    Apr 30, 2018
    Posts:
    122
    Hey, thanks for diving into the product!

    When you press the Play button, Tiny Mode will create a build and actually auto-launch your project in the default browser application (set by your os). You can see this here:


    If that does not happen, then you most likely have hit an error and there may be a Unity console error.

    While developing in Tiny Mode you do not need to meddle with the index.html file (build files) unless of course you are ready to export your final release build somewhere.
     
  3. Raspilicious

    Raspilicious

    Joined:
    Jun 21, 2012
    Posts:
    24
    Pressing Play in the Editor does work - my browser window opens and the game runs. But to play it again, do I have to press Play again? What I would like to do is to:
    a) Be able to play my game without having to run Unity - i.e. making a build
    b) Keep multiple builds (like I would with apks or exes), assumably copying/archiving the /development/ folder

    In both cases, opening the index.html file just renders a white page as empty as the gun room in The Matrix before Neo calls in all the shopping aisles. If there's another place the build is output or another way to build it, I haven't worked out where... yet!
     
  4. etienne_unity

    etienne_unity

    Unity Technologies

    Joined:
    Aug 31, 2017
    Posts:
    102
    Hi Raspilicious,

    Development builds rely on special routes supported by the Tiny web server (available at http://localhost:19050/ by default when Tiny Mode is activated). These routes exist to support rapid iteration workflows.

    If you want to distribute builds, do a Release build, and copy all the files from the output bin folder (index.html is at the root), and serve them using an HTTP server (opening the index.html file in your browser using the file:// scheme will not work in most cases).

    I hope this helps,
    -Etienne.
     
    Raspilicious likes this.
  5. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    200
    When you say do a release build, what do you mean?

    Do we switch to HTML platform? Do we use the menu item File->Tiny->Build or Tiny->File->Build . . . and how do we do a Release instead of Debug?
     
  6. raymondyunity

    raymondyunity

    Unity Technologies

    Joined:
    Apr 30, 2018
    Posts:
    122
    There are two ways to switch the "Build Configuration".

    A) Select a project "ut.project" file and look at the Inspector
    OR
    B) In the "Project Settings" window

    We're trying our best to provide you a better UX workflow so feel free to give us feedback about this.
     

    Attached Files:

    eyworldwide likes this.
  7. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    200
    Thanks!

    I would think having a Tiny Platform option in the Build Menu would be more consistent with the existing workflow.