Unreal Nodes Explained: Time Node

ilkyal3d
6 min readMar 24, 2024

--

Time Node

What does the ‘Time’ node do?

The ‘Time’ node returns the elapsed time since the session* began.

  • (*The session can be your ‘editor’ session, in other words, when you launched the Unreal Engine itself, or when you the play button to test your game.)

Let’s delve into that description, and understand how we can actually use the ‘Time’ node in our games.

In the following screenshot, I’m connecting the ‘Time’ node to a ‘DebugScalarValues’ node, which will print the numeric value that the ‘Time’ node generates. By connecting it to the ‘Base Color’ pin of the master material, we will be able to see which number the ‘Time’ node generates in real-time:

Setup
Result

So the time node started counting as my session began and kept incrementing the number every second. This number here will keep incrementing… Forever.

Imagine plugging this setup’s output into the ‘Emissive’ input of the master material. It would get brighter and brighter and brighter…

Not really helpful to create anything with it as it is.

So the question is, how can we tame the values that ‘Time’ node generates? And that’s where the ‘Sine’ node comes in!

What Does ‘Sine’ Node Do Then?

I think Epic’s documentation is doing a pretty great job at explaining it:

The Sine expression outputs the value of a Sine wave over the input range of [0, 1] and the output range of [-1, 1], both repeating. The difference between this and the output of the Cosine expression is the output waveform is offset by one-quarter of the period, meaning that Cos(X) is equal to Sin(X + 0.25) . Most commonly, this is used to output a continuous oscillating waveform by connecting a Time expression to its input, but it can also be used to create ripples in worldspace or screenspace, or any other application where a continuous, smooth cycle is needed. A visual representation of the wave is shown below, scaled to the [0, 1] output range.

But to simplify it, the ‘Sine’ node, also known as the ‘Sine Wave’, can take the value generated by the ‘Time’ node and squeeze that value into something between -1 and +1 by default. In a way, by adding the ‘Sine’ node into the mix, we can prevent the ‘Time’ node values from going wild.

What’s very important to know is that the ‘Sine’ node is great for creating repetitive shapes, and you’ll often see it used with the ‘Time’ node.

So, as I mentioned, by default, ‘Sine’ takes the value generated by the ‘Time’ node and puts it into a range of -1 to +1. But what if we want a value less than -1 or greater than +1? Then we can add a ‘Multiply’ node to the mix. Let’s take a look at the following setup.

In this setup, I’m adjusting the value of the ‘Time’ node using the ‘Sine’ node. The ‘Sine’ node produces a number that goes from -1 to 1 and then back again in a repeating pattern. But I want the range to be from -2 to 2 and everything in between. So, I’m multiplying the value by three to achieve that:

Setup
Result

I believe this should sufficiently clarify how the ‘Time’ node functions and how we can manipulate its values. Now, let’s delve into real-life examples of how we can utilize this node.

Moving textures, LCD/TV (functioning or broken) material, time warp effects, ripples, water/sea/ocean material, flashing lights, etc.

In the following setup, I introduced a ‘Panner’ node into the mixture to create a ‘warp’ effect. In this specific scenario, we’re using the ‘Panner’ to distort time:

Setup
Result

Let’s make this effect a little bit more intricate. I’ll introduce an albedo texture, and utilize its red channel to augment the value generated by the ‘Time’ node.

What’s happening here is that everything is panned in exactly the same manner, but the white parts of the albedo texture (red channel) are advancing further in time than the black ones (the original texture — the one immediately to the left of the master material):

Setup
Result

See? Now we’re starting to get interesting visuals. I think the ‘Time’ node could be quite handy if you’re working on a cyberpunk-themed game. With it, you can generate a bunch of abstract-looking materials, neon street advertisements, and other types of neon signs.

Now, I will do exactly the same thing, but using a noise texture instead of an albedo texture, to achieve a different result:

Setup
Result

How can we control the waviness of the material?

‘Divide’ node can be helpful in this scenario. Bigger the number, the less wavy/more subtle the material appear:

Reference for ‘Divide’ Node Setup

Other Examples

A very simple digital clock-like effect:

Setup
Result

Club Lights With The Help Of ‘HueShift’ Node:

Setup
Result

Emergency Vehicle Lights:

Setup (No Multiply Node)
Result
Setup (We’re multiplying the end result before feeding it into the master material node to get an exaggerated result.)
Result

If you wish to have 3 colors in the final setup (Emergency Vehicle Lights setup), you can use lerp_3Color node as well.

I hope everything was clear in this tutorial. If you have any further questions, feel free to comment below!

Note: If you are tired of watching video tutorials and would like to see more text-based tutorials like this one from me, you can support me on Patreon so I can dedicate more time to creating them.

--

--