Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

unity_DeltaTime not working?

Discussion in 'Shaders' started by chronosnoj, Aug 18, 2019.

  1. chronosnoj


    May 2, 2018
    Hi all,

    I'm building a simple shader where I'm moving a texture on a line renderer, and I'm encountering a problem with unity_DeltaTime specifically - not sure if I'm using it wrong or not. What I'm doing right now is:

    _shaderTime = _Time.x % 1;
    float u = (i.uv.x + _shaderTime);

    Which is functional, but not ideal. Really, I'd like to do something like this:

    _shaderTime += unity_DeltaTime.x;
    _shaderTime = _shaderTime % 1;
    float u = (i.uv.x + _shaderTime);

    Which would get rid of the ever increasing time value (from what I understand from the docs online, this value continually increments). But unity_DeltaTime doesn't seem to change. _Time, _CosTime, and _SinTime all produce values that I've been able to use to achieve movement in my shader, but _unity_DeltaTime doesn't seem to work no matter what I do. Does it work in some way fundamentally different than what I expect, or is it just broken in some way?

    I'm on 2019.1.4f1 by the way.