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 Scrollbackground : MonoBehaviour
- {
- public float scrollSpeed;
- private Vector3 posicioini;
- private float tamañofondo;
- void Start()
- {
- posicioini = transform.position;
- tamañofondo = transform.localScale.y; //Tamaño A mover Scroll
- }
- void Update()
- {
- float newPosition = Mathf.Repeat(Time.time * scrollSpeed, tamañofondo);
- transform.position = posicioini + Vector3.up * newPosition;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement