Files
UltimateFishing/Assets/Scripts/Assembly-CSharp/FollowTransform.cs
2026-02-21 16:45:37 +08:00

21 lines
339 B
C#

using UnityEngine;
public class FollowTransform : MonoBehaviour
{
public Transform targetTransform;
public bool faceForward;
private void Update()
{
if (targetTransform != null)
{
base.transform.position = targetTransform.position;
if (faceForward)
{
base.transform.forward = targetTransform.forward;
}
}
}
}