- Home /
How to scroll texture of a renderer with multiple elements?
Hello! I have been trying to make tank tracks for a game and have had some decent success. I am though stumpted on this, the tracks have 16 material elements and the scrolling only effects element 0. How would I fix this? There are 16 total elements. Cheers
This is the code:
public Renderer LeftTrackRenderer; public Renderer RightTrackRenderer;
void Update() { currentOffset += direction speed Time.deltaTime;
LeftTrackRenderer.material.SetTextureOffset("_MainTex", currentOffset);
RightTrackRenderer.material.SetTextureOffset("_MainTex", currentOffset);
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How to make proper tanks? 1 Answer
How to offset a texture based on camera movement? 0 Answers
How to change material that is being scrolled for Material.SetTextureOffset 2 Answers