Hey all,
I was wondering if this was possible and how it would be achieved. I have a plane on my stage and a texture attached to it. Currently I scroll the texture based on a value like the following.
stars.renderer.material.SetTextureOffset("_MainTex", new Vector2(0,Time.time * paralaxScrollRatio));
But i was wondering if i could make it more dynamic and have it scroll based on the camera movement in either the x or y at a slower speed.
I was thinking it might be hard to do it based on camera movement. The effect I’m trying to achieve is scrolling parallax stars that scroll based on the direction and speed the camera is moving.
Has anyone got any thought on this. It would be much appreciated.
You're right: I forgot to increment the offset! It was just "shaking" the stars in my code, because the offset was based on the movement since last Update. It should be accumulated over time, like you did in your version - this way the starts move according to the camera displacement.
– aldonaletto