Combinging transform.right and transform.forward?

I have a 2D sprite in a 3D world, I set its ‘right’ transform to its 3D velocity vector.

This is causing a problem as I also want the 2D sprite to be facing the camera.

Here’s a video of my problem: turns - YouTube

I cannot simply set a rotation based on a direction because the sprite will be getting rendered on arbitrary angles as it is being aligned to a spline.

Is there a way I can set right.transform then also set transform.forward so it’s facing towards the camera while maintaining the previous rotation that was applied to it by setting its transform.right?

When you set an object to look somewhere (using either transform.LookAt or Quaternion.LookRotation) you can specify that “free spin,” but based on Y (not X, which is what you want.)

To convert “face Y” into “face X” you could use some quaternion math, or rotate 90 CCW on y after each facing call, but simplest is to child the plane and rotate so faces left (Up on the parent is now Right on the sprite.) Then, something like:

Vector3 moveDir;
mySprite.LookAt(camera, moveDir);
// faces the camera, spun so UP is closest to move direction
mySprite.rotation = Quaternion.LookRotation(toCam, moveDir);