Skip to content

Commit 3490d1d

Browse files
authored
Merge pull request #2457 from PJBowron/billboardCameraTolerance
Billboard camera tolerance
2 parents f356c26 + b6227cb commit 3490d1d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Assets/HoloToolkit/Utilities/Scripts/Billboard.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,28 @@ private void OnEnable()
5353
{
5454
if (TargetTransform == null)
5555
{
56-
TargetTransform = CameraCache.Main.transform;
56+
if (CameraCache.Main != null)
57+
{
58+
TargetTransform = CameraCache.Main.transform;
59+
}
5760
}
5861
}
5962

6063
/// <summary>
6164
/// Keeps the object facing the camera.
6265
/// </summary>
63-
private void Update()
66+
private void LateUpdate()
6467
{
6568
if (TargetTransform == null)
6669
{
67-
return;
70+
if (CameraCache.Main != null)
71+
{
72+
TargetTransform = CameraCache.Main.transform;
73+
}
74+
else
75+
{
76+
return;
77+
}
6878
}
6979

7080
// Get a Vector that points from the target to the main camera.

0 commit comments

Comments
 (0)