1
0
mirror of https://github.com/xiaopeng12138/MaiDXR.git synced 2024-12-18 11:55:52 +01:00
MaiDXR/Assets/MRCHelpers/Scripts/CopyTransform.cs
2022-08-20 21:35:57 +02:00

30 lines
708 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MRCHelpers
{
/// <summary>
/// Copies the position of a transform every frame
/// </summary>
public class CopyTransform : MonoBehaviour
{
/// <summary>
/// The transform to follow
/// </summary>
[SerializeField]
private Transform m_originalTransform;
/// <summary>
/// Update
/// </summary>
void Update()
{
//copy the pose of the other transform each frame
transform.position = m_originalTransform.position;
transform.rotation = m_originalTransform.rotation;
}
}
}