My Learning-Unity3d journy continues, and I’m having loads of fun, but I’ve really been stumped while I’m making my camera…
It’s a simple third-person camera that orbits around the character when you move the mouse. When anything gets between the character and the camera, it snaps forward onto the plane of the object in between the two. This works fine.
My problem is setting the distance of the camera. I want to have a variable that sets the camera’s distance from the target, but I can’t really think of how. Probably some sort of Vector math.
Looking through the docs, I found Vector3.Distance, but there isn’t anything that will set the distance from another object (I guess it would require an angle and the two Vector3s?)
Thanks for any help!