x


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?

more ▼

asked May 07 '12 at 04:29 PM

belac024 gravatar image

belac024
16 3 3 5

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);
}
May 07 '12 at 04:36 PM alucardj
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered May 07 '12 at 07:55 PM

belac024 gravatar image

belac024
16 3 3 5

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x724
x329
x87
x87
x20

asked: May 07 '12 at 04:29 PM

Seen: 529 times

Last Updated: May 07 '12 at 07:57 PM