Looking-Glass/Assets/playerstuff/PositionSync.cs
2024-02-07 19:26:35 +00:00

17 lines
586 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// syncs the position of the player glass and the view in the alternate scene. could probably be better but who cares
public class PositionSync : MonoBehaviour
{
public GameObject targetGameobject;
// Update is called once per frame
void Update()
{
transform.rotation = targetGameobject.transform.rotation;
transform.position = new Vector3(targetGameobject.transform.position.x, targetGameobject.transform.position.y + 100f, targetGameobject.transform.position.z);
}
}