LethalCompany/Lethal Company/ExportedProject/Assets/Scripts/Assembly-CSharp/facePlayerOnAxis.cs
2023-12-22 18:30:10 -05:00

26 lines
499 B
C#

using UnityEngine;
public class facePlayerOnAxis : MonoBehaviour
{
private Transform playerCamera;
public Transform turnAxis;
private bool gotPlayer;
private void Update()
{
if (!gotPlayer)
{
if (GameNetworkManager.Instance != null && GameNetworkManager.Instance.gameHasStarted)
{
playerCamera = GameNetworkManager.Instance.localPlayerController.gameplayCamera.transform;
gotPlayer = true;
}
}
else
{
base.transform.LookAt(playerCamera, turnAxis.up);
}
}
}