x


Look Direction of a gameobject

Hey there! I have a gameobject and when i click on this object, it looks in the direction of the camera (with the function lookAt() ). Is there a way to save the 'old' direction, so when I click on the gameobject again, it looks in the old direction again? Thanks for your reply!

more ▼

asked Jun 16 '12 at 01:22 PM

NeverPanic gravatar image

NeverPanic
2 1 1 2

(comments are locked)
10|3000 characters needed characters left

1 answer: sort newest

Sure just store the transform.rotation in a Quaternion variable and set it back on the second click

more ▼

answered Jun 16 '12 at 01:23 PM

whydoidoit gravatar image

whydoidoit
33k 11 23 99

Excellent! Thanks

Jun 16 '12 at 01:27 PM NeverPanic

No problem - just mark it as answered and I'm a happy man :)

Jun 16 '12 at 01:28 PM whydoidoit
(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:

x1278

asked: Jun 16 '12 at 01:22 PM

Seen: 668 times

Last Updated: Jun 16 '12 at 01:28 PM