How do I rotate an object in relation to the camera?,How do I rotate a sprite in relation to the camera?

Hello!
I am trying to make a sprite (of a mushroom) rotate in relation with my first-person character so that it is always seen from the front no matter what direction one approaches it. Essentially, I want the sprite to rotate in correspondence with camera. I haven’t been able to find the specific answer to this problem anywhere.

Hope this makes sense!

Many thanks in advance!

Tom ,Hello! I’m trying to make a sprite (of a mushroom) to rotate in relation to my first-person character so that it’s front is always facing the character’s camera: so that from whatever angle the character approaches the sprite the front will always be seen. I hope that makes sense!
Many thanks in advance!

Tom

I’d think this would work: gameObject.transform.forward=-Camera.main.transform.forward;

Or maybe this: gameObject.transform.LookAt(Camera.main.transform);

They’re not exactly the same.
Give it a try?

Thank you so much! This works perfectly! I’ve been struggling for ages with this - really appreciate your help.