how to make SetTextureOffset background like this ?

I want this background system using SetTextureOffset. But i cant do it. Please help me.

Goal :

Developers tell how to make it but my poor english prevent me :frowning: Asteroid Base

I’m not in Unity to test it now, but I would think you could do something like this in a script attached to your background material (which should probably be a child object of the camera like in that example):

public Camera theCamera;

void Start() {
 rend = GetComponent<Renderer>();
}

void Update() {
 rend.material.mainTextureOffset = theCamera.transform.position;
}

Edit: It seems like using the mainTextureOffset attribute is preferable to SetTextureOffset, so I modified that code to reflect that.

2 Likes