
Created a camera-wide background and a duplicate and a script that I thought was going to allow for a looping background but I realized it doesn't follow player character.
21 lines
473 B
C#
21 lines
473 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class ScrollingObject : MonoBehaviour {
|
|
|
|
private Rigidbody2D body;
|
|
public float scrollSpeed = -1.5f;
|
|
|
|
// Use this for initialization
|
|
void Start () {
|
|
body = GetComponent<Rigidbody2D>();
|
|
body.velocity = new Vector2(scrollSpeed, 0);
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update () {
|
|
// Maybe add something that stops scrolling when gameover?
|
|
|
|
}
|
|
}
|