How to make a plane with a texture flicker, as if it was animated?

I am trying to make a death scene in my game similar to the one in the Slender games. When you die, you would see the monster’s face and static would flicker all over the screen.

I have the face ready in front of the Main Camera and I have a plane placed in front of the face, closer to the camera. I added the static texture, but my question is:

Is there a script that makes the texture’s offset randomize all the time, making it look as if the static is moving?

I have this happening when I see the monster within the actual game, from this helpful guide, but I want to make this death scene and I am totally in the dark at the moment…

This is where I’m giving you the key but I want you to open the door yourself.

There is a gameObject, with a renderer that has a material :

renderer.material

You want to offset the texture on that material : Unity - Scripting API: Material.mainTextureOffset

renderer.material.mainTextureOffset = Vector2( valueX, valueY);

Then you want to randomize the offset between 0 and 1 : Unity - Scripting API: Random.value

var valueX : float = Random.value;
var valueY : float = Random.value;

Put it all together in a script on it’s own, then attach it to the static object :

function Update()
{
    var valueX : float = Random.value;
    var valueY : float = Random.value;
 
    renderer.material.mainTextureOffset = Vector2( valueX, valueY );
}

exactly the same as the OffsetMainTexture() function