I'm using PUN2 and trying to use nametag billboards for my players, but they are not facing forward correctly and I have to wait more than 20 seconds to make the name tag of player return to facing forward.
here's my code for my BillBoard
Script:
public class BillBoard : MonoBehaviour
{
protected Transform ThisCameraPlayerBillBoard ;
private void Start()
{
ThisCameraPlayerBillBoard = GameSetup.GS.ThisCameraToBillBoard.GetComponent<Camera>().transform;
}
private void FixedUpdate()
{
transform.LookAt(transform.position + ThisCameraPlayerBillBoard .rotation * Vector3.forward,
ThisCameraPlayerBillBoard .rotation * Vector3.up);
}
}
FixedUpdate
- usually we'd apply billboarding effects on text inLateUpdate
. \$\endgroup\$ThisCameraPlayerBillBoard
in itsStart
method, which is called a single time? \$\endgroup\$