Spirinaut/Assets/Scripts/Paralax.cs
Gerard Gascón 8103d0d89d init
2025-04-24 14:15:32 +02:00

15 lines
406 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Paralax : MonoBehaviour{
[SerializeField] GameObject reference;
[SerializeField] float scroll;
// Update is called once per frame
void Update(){
Vector2 pos = new Vector2(reference.transform.position.x * scroll, transform.position.y * .05f);
transform.position = pos;
}
}