Hello, I have 2 game objects in diffrent positions and I duplucated the first object in the same positions..Now I have three Objects. How can I change the 3.object's position in the direction between the first 2 objects?
I tried to use Vector3.Distance but I couldn't find the way :(
My purpose is to be able to control the camera in horizontal way for zoom..
'Zoom' is a term used generally with the Camera's FOV (field of view). If I understand you, you want to turn object 3 to LookAt the point between object 1 and object 2, is that correct? If so, add object 1's position to object 2's position and divide by 2. That gives the mid-point on a line between 1 and 2. Then use Transform.LookAt at that point. If you want to transition to that point, use a Slerp function. Examples are in the docs.
answered Feb 29 '12 at 01:12 AM