Hi,
Upon investigating your code, I narrowed the problem down to the AdjustDelta method in the ProCamera2DNumericBoundaries script, specifically to the call to Unity's Mathf.SmoothDamp.
I noticed that after setting the timescale from 0 to 1, this method was returning NaN (sometimes!)
Having then had a look on the Unity Forums, I found this article:
In the last part of the answer, and also the subsequent reply, I noticed that these people were also having problems when the timestep had changed from 0.
So, my first ugly hack to test a potential solution is something like this:
1) Call Mathf.SmoothDamp as usual
2) Check the return value is NaN
3) If it is, call Mathf.SmoothDamp again, but use one of the overloaded versions, passing in the Time.UnscaledDeltaTime (which is not affected by Timescale)
This does produce an ugly jerking when it occurs, but at least it catches up with itself, rather than allowing the camera target to go off screen!
...anyway, I started then to consider changing the code to use an alternative version of SmoothDamp (based on Unity's source code, which is contained within the same forum post i linked earlier), just for neatness (which would internally use UnscaledDeltaTime if DeltaTime produced a NaN), and then I was going to suggest this as a solution.
However, when searching your source code for all references to SmoothDamp, I noticed all of them except the one in ProCamera2DNumericBoundaries use either delta time passed in as an argument (which, for the benefit of any users who read this, is either delta,unscaled delta, fixed delta or unscaled fixed delta, depending on the value of the Update Type dropdown and the Ignore Timescale checkbox), or they use ProCamera2D.DeltaTime.
Therefore I passed your deltatime argument to SmoothDamp, and it fixes the problem!
This does however lead me to question a few things:
1) Is there any reason that you deliberately did not use the delta argument in ProCamera2DNumericBoundaries . i.e. did you forsee a problem with using unscaled time with the bounderies module, or was it just by mistake? If it was a mistake on your part, then may I suggest you use it in future versions?
2) I don't really know why I have the IgnoreTimescale set, though; is it the default value for ProCamera2D?
3) Using the delta time argument if the IgnoreTimescale flag is not set will STILL cause the NaN error, so I still think an improved version of SmoothDamp should be written to check for NaN, and perhaps either use a Lerp if it is a NaN, or maybe just use my hack as a failsafe.
However, the slight change I have made fixes my problem, so I am happy!
..although it is now gone midnight, and my brain is fried, so I hope I am not speaking too soon... but I haven't reproduced the error in about 100 attempts so far!
Anyway, I hope this helps.
I hope you aren't offended by me going into such detail of your code; but I really wanted a solution (I really didn't want the alternative of having to remove the camera and either write my own or use someone else's!) - plus I like to help where I can!
--Mike--