Files

22 lines
547 B
C#
Raw Permalink Normal View History

2026-04-28 16:48:04 +08:00
using UnityEngine;
namespace Unity.RenderStreaming.Samples
{
class FollowTransform : MonoBehaviour
{
[SerializeField] Transform target;
[SerializeField] Vector3 offset;
[SerializeField] bool followPosition;
[SerializeField] bool followRotation;
private void Update()
{
if (followPosition)
transform.localPosition = target.localPosition + offset;
if (followRotation)
transform.localRotation = target.localRotation;
}
}
}