I’m encountering an issue with camera script control in Cesium within Unity. My goal is to implement a camera interaction where, while the dynamic camera is continuously centered at the origin of Unity coordinates, holding down the right mouse button allows me to cast a ray onto the ground, obtaining the collision point A. At this point, I want the camera to rotate around point A using Unity’s method.transform.RotateAround
The challenge arises because as the camera moves, the center point of Unity also changes dynamically, impacting the intended behavior of this mouse interaction. I am seeking guidance on how to address this issue and achieve the desired effect.
Steps to Reproduce:
- Keep the dynamic camera centered at the Unity origin.
- Hold down the right mouse button to cast a ray onto the ground.
- Obtain the collision point A.
- Attempt to rotate the camera around point A using .
transform.RotateAround
Expected Result: The camera smoothly rotates around the collision point A on the ground, despite the dynamic movement of the camera.
Actual Result: Due to the dynamic change in Unity’s center point, the camera’s rotation around point A is not achieving the expected behavior.
Questions:
- How can I maintain the intended camera rotation around point A, considering the dynamic movement of the camera and Unity’s changing center point?
- Are there alternative methods or approaches to achieve this camera interaction without being affected by changes in Unity’s center point?
Note: I appreciate any insights or suggestions on resolving this issue and optimizing the camera script control for the described scenario.