Unity 3D Road Manager Script! How we manage a road image on scene

in unity •  5 years ago 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Road : MonoBehaviour {
public GameObject plance;
public Renderer planeRenderer;
public float speed = 1f;
private Vector2 offset;
// Use this for initialization
void Start () {
planeRenderer = plance.GetComponent<Renderer ();
}

// Update is called once per frame
void Update () {
    offset.y += -speed * Time.deltaTime;
    planeRenderer.material.SetTextureOffset ("_MainTex", offset);
}

}Road Non Sprite.jpgRoad Non Sprite.jpg

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!