Answers for "how to change the offset unity"

C#
0

how to change the offset unity

using UnityEngine;public class Example : MonoBehaviour
{
    // Scroll the main texture based on time    float scrollSpeed = 0.5f;
    Renderer rend;    void Start()
    {
        rend = GetComponent<Renderer> ();
    }    void Update()
    {
        float offset = Time.time * scrollSpeed;
        rend.material.mainTextureOffset = new Vector2(offset, 0);
    }
}
Posted by: Guest on February-25-2021

Code answers related to "how to change the offset unity"

C# Answers by Framework

Browse Popular Code Answers by Language