Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

[HELP] Debugging

Discussion in 'Project Tiny' started by vincismurf, Jan 6, 2019.

  1. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    98
    What is the best way to debug Tiny? What does the Debug mode in the Tiny Build Settings do?

    I have ran across a few instances where I destroy an entity group and later re instantiate it and it appears that the values from the last instance of the EntityGroup persist. Normally I would set a breakpoint and step thru the debugger looking at the call stack and watched variables but I don't seem to know how to set that up for Tiny and TypeScript.

    Could someone point me in the right direction?
     
  2. raymondyunity

    raymondyunity

    Unity Technologies

    Joined:
    Apr 30, 2018
    Posts:
    34
    The best way to debug your Tiny project is with web debugging practices. You can add breakpoints in developer mode If you are unfamiliar with that then this guide can help you get started: https://developers.google.com/web/tools/chrome-devtools/javascript/. Chrome and Firefox are very similar when it comes to debugging.

    You would probably want to inspect and add breakpoints in your code which will be located in a "tsc-emit.js" file. You can even go as far as diving into the "assets.js" and "entities.js" files where assets and entities are initialized.

    When you have "Tiny > Enable Play Mode" menu item active and you click play while in a Development build you will enter Live-Link mode. This will allow you to inspect your entities directly in Unity when you press the Pause button. Please note that the Live-Link mode is a work in progress and far from being fully featured (it is not even documented yet).

    Last but not least, console.log outputs.

    Tiny build settings summary:
    Debug: This contains no optimizations but includes debug information (call stack, etc.). This is really meant for internal developers.
    Development: This contains optimizations and debug information. Use this whenever you are not planning on publishing your project.
    Release: Use this when you are building your project and ready to publish it. This contains optimizations but no debug information.
     
    vincismurf likes this.
  3. vincismurf

    vincismurf

    Joined:
    Feb 28, 2013
    Posts:
    98
    Thank one minor follow up . . . when I try to debug with VSCode it complains about a missing "node". . . . could you provide any tips for attaching VSCode to the Tiny Unity build?
     
  4. raymondyunity

    raymondyunity

    Unity Technologies

    Joined:
    Apr 30, 2018
    Posts:
    34
    Don't attach it. We're not supporting that sort of "web app debugging" setup right now.
     
    frankprogrammer and vincismurf like this.