I am putting together a Google Maps style camera. Two touch controls can pan, zoom and rotate around a selected point on a floor. However when I try and pan while rotating around the point things go wonky. There is a conflict between the pan changing the position and the RotateAround changing the position.
I somehow need to write code that takes care of this but I don’t know how RotateAround is written. Anyone have an idea?
Could you post the code you have so we can help ou figure out where the conflict is?
OK, your problem is that transform.RotateAround doesn’t return anything - it actually changes the transform’s position and rotation to rotate it around the given point. At the moment you’re adding a “void” to a Vector3 - that code shouldn’t be compiling at all.
Try moving the transform.RotateAround to its own line either before or after the part where you change the camera’s position.
All I really want to know is how I would write my own RotateAround code…
Ah! Thanks @JamesLeeNZ
Its funny because I was just looking it up last night since RotateAround is marked as obsolete