Files
BlockSpace-v1.5.0b/Assets/Scripts/Assembly-CSharp/Photon/VR/Player/PhotonVRPlayerName.cs
T
2026-06-01 17:19:55 +02:00

21 lines
633 B
C#

using UnityEngine;
namespace Photon.VR.Player
{
public class PhotonVRPlayerName : MonoBehaviour
{
[Tooltip("How high the text should be above the players head")]
public float Offset = 0.17f;
public Transform Head;
private void Update()
{
base.transform.position = Head.position + new Vector3(0f, Offset, 0f);
Vector3 forward = PhotonVRManager.Manager.Head.position - base.transform.position;
Quaternion b = new Quaternion(0f, Quaternion.LookRotation(forward).y, 0f, Quaternion.LookRotation(forward).w);
base.transform.rotation = Quaternion.Slerp(base.transform.rotation, b, 10f * Time.deltaTime);
}
}
}