So after long hours i encountered an article about animation curves being not safe, which would explain why curve.Evaluate would return some random numbers.
I guess it has to do with some caching and multiple threads override each other and cause some memory errors but my question is if it will be ever fixed/changed? I don’t know if any engine dev reads those questions but yeah, it would be helpful to even have some info on wiki that animation curves aren’t thread safe.
Here is article: Tim Aksu — TIL Animation Curves are not thread safe (and a...
In Unity, animation curves are not thread safe. This means that if multiple threads try to access and modify the same animation curve simultaneously, it can lead to unpredictable behavior and potential memory errors. It is recommended to use locks or other synchronization mechanisms to ensure that only one thread can access and modify the animation curve at a time. This will prevent any potential memory errors and ensure that the animation curve is used in a safe and predictable manner. It is also recommended to check the Unity documentation and forum for any updates or changes to the behavior of animation curves in future versions of the engine.