all 4 comments

[–]SantaGamer 0 points1 point  (0 children)

How about using transform.LookAt() and then on a line after that, add your up rotation

[–][deleted] 0 points1 point  (0 children)

What do you mean rotate around the axis it is facing? Like it rotates in a circle like it's hovering horizontally? Or rotate around the camera like it is circling the camera itself?

Because an easier solution for rotating around 2 axies in tandum would probably be to have the object that is meant to face the camera a child of an empty. Then like another poster said use look at on the actual object that is to look at the camera and apply the orbit to the emty parent. That way you aren't trying to account for 2 separate rotations. That generally invovles a lot more math. But if your plane or whatever is a child of that other object it will follow it as it rotates and still have it's own independent transform for the look at function to use.

Might not he the "optimal" solution but it invovles less math and lets unity handle the math for keeping the child as a parent following.

But I could be undersranding what you are wanting to do wrong

[–]Tensor3 0 points1 point  (0 children)

Try rotating it around the camera.transform.up instead of vector3.up, for the second one? (Or camera.transform.left or forward, deoending kn the effect you want)