- Home /
LookAt() and RotateAround()
I have a wall and I want to RotateAround() on the Y-Axis around a point that is at the left end of the wall and make the wall LookAt() another point on the grid. So if I put a point at (1,1) and one at (4,4) the wall will connect point 1,1 and point 4,4. I already have the distance calculated. I can only ever get one or the other to work and not together. any ideas?
Comment
RotateAround is a change in angle that is applied over time (so it needs an update or some continuous loop to work properly), LookAt immediately snaps to a rotation.
so what you want may be :
var target : Vector3;
function Start()
{
target = Vector3(0,0,0);
transform.LookAt(target);
}
Answer by belac024 · May 07, 2012 at 07:55 PM
I guess A better way to ask this would be how to I use LookAt() with RotateAround() the Y axis, i doesn't have to be in the Start function.