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

22 lines
473 B
C#
Raw Normal View History

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