Search Unity

HOT RELOAD - Edit Code Without Compiling!

Discussion in 'Assets and Asset Store' started by reese015, Jan 23, 2023.

  1. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    We will actually be rolling out a fix very soon which will drastically reduce the size of the package (down to around 22MB).

    I believe this should resolve the issue for the most part, but if not we can reconsider incremental updating further down the line.
     
    ksf000, eterlan and IgorBoyko like this.
  2. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Hello!

    1. Yes, Assembly Definitions are supported.
    2. A full compile of every script is required.

    Fast Script Reload is not different in that case; it will also have to fully recompile whenever you import a new asset from the Asset Store.

    The compile window will appear less if you don't refresh Unity. So, as long as you have auto refresh disabled and refresh manually with Ctrl + R only if absolutely needed, you shouldn't run into too many recompiles (barring importing new assets).

    Feel free to try it out for yourself though - it's free forever if you're using Unity Personal, and you have an unrestricted 30-day free trial if you're using Unity Plus/Pro/Enterprise. I'm just mentioning it because it sounds like you think you have to pay for it up front, when in reality you can start playing around with it for free to figure out if it fits well into your workflow or not :)

    Hope this helps!
     
    eterlan likes this.
  3. michielproce

    michielproce

    Joined:
    Jan 25, 2019
    Posts:
    1
    My Rider IDE doesn't hit breakpoints after a hot reload. Is this something that will be supported in the future?
     
  4. AngelGalaxyOfficial

    AngelGalaxyOfficial

    Joined:
    Apr 10, 2021
    Posts:
    16
    Thanks so much for your reply, this is more than satisfactory for me. I just wanted to be completely certain! I'll grab it now, thank you so much!
     
  5. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Yes, we will be adding proper debugger support in the near future.
     
    eterlan likes this.
  6. reese015

    reese015

    Joined:
    Nov 29, 2014
    Posts:
    34
    Hey everyone!

    We just released version 1.5.2.

    Features:
    • Added support for patching Android Player builds on-device
    Improvements:
    • Reduce package file size drastically
    • Expose API to start / stop the Hot Reload CLI programmatically

    This build features the first version of our on-device support. We are still working on improving our on-device support in many regards, so feedback or bug reports are greatly appreciated!
     
    TroyDraws, eterlan and IgorBoyko like this.
  7. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    Can't observe that behaviour a few days, so it' fine now, thanks!
     
    Koara92 likes this.
  8. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    @Koara92 Hi! Here is a little problem, not a big deal, just want to let you guys know. When I open two unity projects, the hotreload window on each side is running and compile at each place.
    Have a nice day!
     
  9. TroyDraws

    TroyDraws

    Joined:
    Apr 29, 2017
    Posts:
    13
    - it is planned internally to support two projects concurrently
    - I will get to this sometime after you can Hot Reload a Standlone / Desktop build
     
    eterlan likes this.
  10. reese015

    reese015

    Joined:
    Nov 29, 2014
    Posts:
    34
    Hey everyone!

    We just released version 1.6.2.

    Improvements:
    • Reduce package file size further (down to 3.5 MB)
    • Remove requirement for git-lfs to be installed to be able to use the git url in the Unity package manager
    Fixes:
    • Fixed regression where Hot Reload would log errors when git is not installed
     
    RanchaG likes this.
  11. Luemus

    Luemus

    Joined:
    May 20, 2013
    Posts:
    107
    Hello @reese015, I currently use Unity Pro for free as a student, so unfortunately I fall in the business tier. Do you provide licenses for students to use with their free Unity Pro subscriptions?
     
  12. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    Why do you use Pro to begin with?
     
  13. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Hi there, yes we do! Send me a private message here or contact us through the form on our website with your student email address, and we will be happy to provide you with a license so you can continue using Hot Reload for free.
     
    Luemus likes this.
  14. Luemus

    Luemus

    Joined:
    May 20, 2013
    Posts:
    107
    Back in the day for dark mode, now just because it automatically renews and I am too lazy to click 3 buttons. Other than that the question is still valid as some other student might have a game in production and they just don't want splash screen and switching between personal/pro might be a hassle.
     
  15. reese015

    reese015

    Joined:
    Nov 29, 2014
    Posts:
    34
    Hey everyone!

    We just released version 1.6.5.

    Features:
    • Added logout button which allows reusing the same license on different devices (Unity Plus/Pro/Enterprise only)
    • Added a simple demo scene
    Improvements:
    • When 'AutoRefresh' settings gets modified by Hot Reload we display an informational prompt explaining that users need to refresh their assets with a default Unity shortcut (Ctrl+R). Some users got confused by Unity not automatically refreshing suddenly
    • Minor aesthetic improvements
    • Hot Reload errors and warning are now displayed in Unity Editor console
    • Close the Hot Reload console window when the corresponding Unity Editor process exits
    • Seamless package update flow for packages installed via .unitypackage
     
  16. reese015

    reese015

    Joined:
    Nov 29, 2014
    Posts:
    34
    Yes, as @Koara92 said we provide licenses for students using paid versions of Unity. Please contact us with your student email through the contact form on our website so we can help you out.
     
    Luemus likes this.
  17. reese015

    reese015

    Joined:
    Nov 29, 2014
    Posts:
    34
    Hey everyone!

    We just released version 1.7.0.

    Features:
    • Added support for adding new Unity event methods (Update, Awake, etc.)
    Improvements:
    • Fixed an issue where the update available indication wouldn't appear when a more recent package version is available in certain scenarios

    With regards to Unity events, all built-in events are supported (see Messages section here: https://docs.unity3d.com/2018.4/Documentation/ScriptReference/MonoBehaviour.html).

    Some caveats:
    • Removing Unity events is not supported; you can work around this by commenting out the method body instead
    • A new OnDestroy method does not get called if only the component is destroyed; it only fires if the entire game object is destroyed
    • New Unity event methods are not called on MonoBehaviours which get loaded in play mode as part of a scene (i.e. by using SceneManager.LoadScene)
     
  18. Foxaphantsum

    Foxaphantsum

    Joined:
    Jul 5, 2013
    Posts:
    139
    Amazing tool!.
     
    Koara92 likes this.
  19. Sandler

    Sandler

    Joined:
    Nov 6, 2015
    Posts:
    241
    just got to try it out with 1.7
    what can i say.. great tool unity should buy you guys out :) this will probably become one of the most used extensions ever. keep pushing!
     
    Koara92 likes this.
  20. ksf000

    ksf000

    Joined:
    Mar 15, 2021
    Posts:
    6
    I just found a small issue. The "Refresh" button in the "Hot Reload" window prompted me to update from 1.6.5 to 1.7.0. And when it was finished, I saw the button again - to update to 1.7.1.
     
  21. reese015

    reese015

    Joined:
    Nov 29, 2014
    Posts:
    34
    Hey everyone!

    We just released version 1.7.1.

    Fixes:
    • Fixed issue where Hot Reload wouldn't pick up on file changes
    • Fixed an occasional UnauthorizedAccessException error log when starting Hot Reload
     
    eterlan likes this.
  22. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    We fetch the latest version every hour and on domain reload. In your case, it's likely that you just updated to 1.7.0 right around the time we released 1.7.1.

    Thanks for the heads up though!
     
    ksf000 likes this.
  23. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    1,091
    Tried asset again but it still fails. Was CodeAnalsysis finally updated or not?


    Repro still the same (update hot reload version):
    Maybe something was changed as first compilation doesn't fail but then any hot reloaded change (unrelated to source generator) fails.
     
    Last edited: Mar 3, 2023
  24. Luemus

    Luemus

    Joined:
    May 20, 2013
    Posts:
    107
    Works great, will probably use on every project from now on!
     
  25. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    We likely accidentally broke it again after making some bigger changes. We'll take another look and get this fixed for a future release.

    Sorry about that!
     
    Kamyker likes this.
  26. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Quick announcement:

    We are currently finalizing a release which includes Hot Reload support for Burst.

    Before release, we would like to first roll it out as a closed beta for people who actively use Burst. Since we don't use Burst for our main project, it would be great if we could get some people who frequently use Unity jobs like
    IJob
    ,
    IJobFor
    ,
    IJobParallelFor
    to help us test the new release before we make it public.

    For version 1, Hot Reloading Unity ECS systems are not supported. The same goes for methods that are compiled via
    FunctionPointer<T>
    .

    If you would like to try out our Burst release while it's still in beta, please send me a DM.

    Thank you!
     
  27. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    It's insane! One reason I choose Entitas not dots is because it doesn't support hot reload, never think of you can did it! I thought it claims using self-made compiler or something. Any way, really cool!
     
  28. jannysice

    jannysice

    Joined:
    Jun 8, 2017
    Posts:
    11
    Yes, unity has their own burst compiler which runs separate from the c# compiler.
    The fact that unity doesn't expose good api to burst compile code made it very difficult.
    That's why I took us a about two weeks but we actually found a way to do hot reloads for burst compiled code.
    Since we are not using burst ourselves in our game we could only do basic testing ourselves but we couldn't really battle test it. That's why it would be great if people try it out and give feed back.
     
    eterlan likes this.
  29. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    @Koara92 Hi, just want to know if there is going to be any add new field support? Really awesome if we can have that, everything else is perfect now. Not urging you guys, I'm fine without that. Have a nice day!:)
     
  30. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Yes, new field support is on the roadmap. It will likely come after debugger support.
     
    ksf000 and eterlan like this.
  31. reese015

    reese015

    Joined:
    Nov 29, 2014
    Posts:
    34
    Hey everyone!

    We just released version 1.8.0.

    Features:
    • Added support for Hot Reloading Unity jobs. Currently, the following types are supported: IJob, IJobFor, IJobParallelFor, IJobParallelForTransform, IJobParticleSystem, IJobParticleSystemParallelFor, IJobParticleSystemParallelForBatch
    • Added link to issue tracker in the about tab
    Fixes:
    • Fixed issue where networking code was causing port exhaustion
    • Fixed issue where changing a property to use the arrow syntax ( => ) instead of an expression body was failing hot reloads for the affected file

    In Unity 2022 and up, there is currently a warning every time a Unity job is Hot Reloaded (example). Unfortunately, this error seems to be unavoidable and will always be logged whenever a job is Hot Reloaded. For more information, refer to this post from a Unity employee explaining why this warning is logged.

    Otherwise, please let us know if you run into any issues with the new Burst support! Thanks!
     
    andreiagmu and IgorBoyko like this.
  32. Pnvanol

    Pnvanol

    Joined:
    Jan 11, 2016
    Posts:
    123
    I cant seem to disable auto update on Unity, I have these settings and still its showing compiling on the console
    every single change I make in the code.
    Im on Unity on Linux, version 2021.3.20f1
    HotReload version 1.8.0


    upload_2023-3-8_13-36-41.png
     
  33. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    Hi @Koara92 , I was wondering why open hot reload server is so slow, it just show first line for about a few minutes. It doesn't happen at much earlier version. I'm in China, maybe it's internet problem? Have a nice day!
     
  34. GoldFireStudios

    GoldFireStudios

    Joined:
    Nov 21, 2018
    Posts:
    160
    Is there a way to force restart Hot Reload? It seems to get stuck when I switch branches, and even with a force recompile it won't update code in files that weren't present on the prior branch. Then, I closed the console window (on a Mac), and Hot Reload still says it is running. I restarted Unity and it still says it is running when it isn't. There doesn't appear to be a way to get it actually running and now I have to force recompile constantly, making the situation worse than before Hot Reload.
     
  35. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Perhaps this has something to do with the new Burst support update.

    Can you add a hot-reload-config.json file in the Unity project folder? The content should be as follows:

    Code (CSharp):
    1. {
    2.     "disableBurstSupport": true
    3. }
    This will of course disable support for Burst, but it would be interesting to know if you find any performance changes when this is included.

    Let me know!
     
    eterlan likes this.
  36. Sandler

    Sandler

    Joined:
    Nov 6, 2015
    Posts:
    241
    hey im not sure if its a general problem, but if working in #if UNITY_EDITOR code you still needs to manually recompile. And i also had the issue with 1.73 that even hitting ctrl-r would not update it correctly. When double clicking on the - already removed - log output i landed where the method was being called (no error present).

    Maybe add an checkbox to the hot reload window, that lets people toggle if unity native compiling should be used (Unity Auto Refresh)
     
    andreiagmu likes this.
  37. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Unfortunately we aren't able to replicate this at all. Are changes still auto refreshed with that setting disabled even when Hot Reload isn't installed?
     
  38. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    I test multiple times, yes you are right! Now it start lightning fast!
     
  39. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Unfortunately we are not able to reproduce this either. Here's an example video of #if UNITY_EDITOR working for us.

    What Unity version are you using? What operating system are you running it on? Are you using the on-device feature, or are you just trying to hot reload code in the Unity editor?
     
  40. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Sorry for the late reply, but I've already forwarded this info to our coders and am awaiting a reply. It sounds like this is a bug we need to address though.
     
  41. Pnvanol

    Pnvanol

    Joined:
    Jan 11, 2016
    Posts:
    123
    It really seems like a unity bug , that wont allow to disable autorefresh, thus making this plug in useless. I hope unity fixes it soon
     
  42. Sandler

    Sandler

    Joined:
    Nov 6, 2015
    Posts:
    241
    hi also a little late.

    Im using unity ... 2020.3.21f1 Personal on windows 10 with latest patches.
    The code im working on is editor code which is ridiculously nested. Its basically the games main spawn loop and i decided to visualize it by hanging editor code into

    I was just testing around to see if i can reproduce it and first i thought so, but i think it comes down to not seeing the compile time errors since they are warnings now? My keyboard is slightly broken and sometimes inserts , so its most likely that i just didn't realize i had a compile time error.
    Maybe consider making compile time errors way more prominent, since its easy to oversee if you are not used to. (ill report if i ran into this issue again)
     
  43. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    Emmm, it sometimes not work, so I'm not sure why.. What I know is after first time run, rerun the hot reload is quite fast. Is possible some network problem? I'm in China so ..
     
  44. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    It's likely an internet connection issue, yes. We do a daily license check, and if that happens when you have a poor connection, Hot Reload won't start.

    We will investigate possible solutions to see if there are some improvements to be made here.
     
  45. reese015

    reese015

    Joined:
    Nov 29, 2014
    Posts:
    34
    Hey everyone!

    We just released version 1.8.1.

    Improvements:
    • When an instance of Hot Reload is already running, starting a new instance will clearly indicate that it's unable to start unless all other instances are fully closed. This can be helpful when, for example, a previous instance didn't fully shut down in which case manual intervention via (i.e. the Task Manager) is required
    • Documentation button is now always shown at the bottom of Hot Reload window
    • Hot Reload now always shuts down when corresponding Unity Editor closes
    • While installing additional components, the login screen is hidden to not interfere with the install process
    • Fetch latest package version again when the user presses upgrade in the Hot Reload Window to avoid the case where the user has to potentially upgrade multiple times
    • Added prompt asking the user to install additional components before actually starting the install process
    • Added a One-Pager documentation to the package
    Fixes:
    • Fixed support for Roslyn Source Generators
    • Fixed the demo scene to be compatible with the On-Device feature
    • Fixed performance regression that got introduced with the burst support update (on some machines Hot Reload would not start or startup would take very long)
     
    andreiagmu, ksf000 and eterlan like this.
  46. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Should be fixed in the latest version! We tried with the test project you provided and it worked after the fix we added.
     
    Kamyker likes this.
  47. eterlan

    eterlan

    Joined:
    Sep 29, 2018
    Posts:
    177
    Cool! Most of time it's very fast after disable burst support, so it's not a high priority issue. Any way, thanks, hope you have a nice day!
     
  48. reese015

    reese015

    Joined:
    Nov 29, 2014
    Posts:
    34
    Hey everyone!

    We just released version 1.8.2.

    Fixes:
    • Fixed Hot Reload not working on Mac
     
    andreiagmu, IgorBoyko and eterlan like this.
  49. TroyDraws

    TroyDraws

    Joined:
    Apr 29, 2017
    Posts:
    13
    If you're curious about on-device, check out this demo video:


    For me personally, I sometimes need to see a guy explaining the new thing before I feel comfortable giving it a chance.

    The video quality is maybe a bit scuffed but I'm confident you guys can see what's going on there.
     
    andreiagmu and eterlan like this.
  50. Liam2349

    Liam2349

    Joined:
    Mar 10, 2016
    Posts:
    83
    Hi, I want to say I've been using this and it's a great help. I'm on Unity Free so thanks for making it available. Normal script reloads take about 20 seconds for me (even without domain reloading).

    I've used it for a lot of things, but for example, I am working on an open-world game and my map is procedurally generated. Fast iteration times help me to visually debug things, by adding "markers" (cubes) to my grid cells to visualize them, and by changing the alignment logic and quickly checking the results.

    I still use normal debugging usually when I have a problem with collections and I want to check what is in them, I find it less practical to print thousands of Vector3s to the console, but I am usually running release mode with Hot Reload now.

    This project helps a lot with iteration time, Unity should definitely be looking at making this a core feature, it works really well!
     
    TroyDraws, andreiagmu, ksf000 and 3 others like this.