- You can easily make it with Quaternion.LookRotation. :
for(int i = 0; i < slides.Count; i++)
{
GameObject obj = slides[i] as GameObject;
Vector3 relativePos = obj.transform.position - camera.transform.position;
Quaternion rotation = Quaternion.LookRotation(relativePos, camera.transform.up);
obj.transform.rotation = rotation;
}
This page is auto-translated from /nishio/εΈΈγ«γγ‘γγεγγγ using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. Iβm very happy to spread my thought to non-Japanese readers.