This repository has been archived on 2025-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
project-undercover/Game 1/Assets/Scripts/ScrollingObject.cs
calebp 3a91e4feb2 Background Setup
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.
2017-09-03 16:36:57 -05:00

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?
}
}