Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class ScrollTexture : MonoBehaviour
- {
- public float scrollSpeedX = 0f;
- public float scrollSpeedY = 0f;
- Renderer rend;
- void Start()
- {
- rend = GetComponent<Renderer>();
- }
- void Update()
- {
- float offsetx = Time.time * scrollSpeedX;
- float offsety = Time.time * scrollSpeedY;
- rend.material.SetTextureOffset("_MainTex", new Vector2(offsetx, offsety));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement