Question by
unity_FyPKcv4aN7qDIA · Sep 30, 2020 at 03:07 AM ·
c#billboardinghealth
need help with billboarding
hi! i recently looked up a tutorial because i wanted an object to look at the camera as the player moves around. i used what i saw in the tutorial, but it doesn't work?
here's what i have written:
public class cameraBillboard : MonoBehaviour
{
private void Update()
{
transform.LookAt(Camera.main.transform.position, -Vector3.up);
}
}
and here's the error it gives me:
[21:39:04] NullReferenceException: Object reference not set to an instance of an object cameraBillboard.LateUpdate () (at Assets/cameraBillboard.cs:9)
Comment
Your answer
Follow this Question
Related Questions
need help with billboarding 0 Answers
How to instantiate the whole object with script attached to it ? 0 Answers
How to make a particle effect do damage? 4 Answers
Destroy 2D obj issue 3 Answers