HeavenStudio/Assets/Scripts/Common/FollowMouse.cs
2022-01-10 19:17:29 -05:00

17 lines
417 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace RhythmHeavenMania.Common
{
public class FollowMouse : MonoBehaviour
{
public Vector2 offset;
private void Update()
{
var pos = Camera.main.ScreenToWorldPoint(Input.mousePosition);
transform.position = new Vector3(pos.x - offset.x, pos.y - offset.y, 0);
}
}
}