ZoeRobotIngles/Assets/Scripts/Gamification/Gamification_CameraMove.cs

25 lines
617 B
C#
Raw Normal View History

2026-01-26 22:56:16 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Gamification_CameraMove : MonoBehaviour
{
Transform player;
public Vector2 dif = new Vector2(0, 0);
public static Gamification_CameraMove instance;
// Start is called before the first frame update
void Awake()
{
instance = this;
player = GameObject.Find("Player").GetComponent<Transform>();
}
// Update is called once per frame
void FixedUpdate()
{
transform.position = Vector2.Lerp(transform.position, (Vector2)player.position + dif, .05f);
}
}