Files
CartoonRPG/Assets/StixGames/GrassShader/Scripts/CameraFollow.cs

23 lines
518 B
C#
Raw Normal View History

2025-06-05 22:59:18 +01:00
using UnityEngine;
namespace StixGames.GrassShader
{
[AddComponentMenu("Stix Games/Interaction/Camera Follow", 100)]
public class CameraFollow : MonoBehaviour
{
public Transform follow;
public float followHeight = 20;
private void Update()
{
if (follow == null)
{
follow = Camera.main.transform;
return;
}
transform.position = follow.position + Vector3.up*followHeight;
}
}
}