x


Change FPS Rotation

When player clicks on object the player (fps) is then moved to the position specified but I am having difficulty get the player then to face the right way to look at an object on the wall at the same time:

GameObject.Find("ScottController").transform.position = new Vector3 (-6.103598, 6.474478, 8.466862);

I have tried simialr ways to above for the rotation I was hoping it was something as simple as:

GameObject.Find("ScottController").transform.rotation = new Vector3 (0, 360, 0);

but I was wrong

more ▼

asked Mar 26 '10 at 03:59 PM

Scott 2 gravatar image

Scott 2
42 4 4 6

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

1 answer: sort voted first

Try using the LookAt instead:

GameObject.Find("ScottController").transform.LookAt(target)

Where target is the object that you clicked on.

more ▼

answered Mar 26 '10 at 04:15 PM

Lipis gravatar image

Lipis
2.3k 10 22 48

Thank you will look at that

Mar 26 '10 at 04:32 PM Scott 2

I have had a try but won't look at the object (cube) only assets

Mar 26 '10 at 05:30 PM Scott 2
(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:

x2168
x1175

asked: Mar 26 '10 at 03:59 PM

Seen: 1108 times

Last Updated: Mar 26 '10 at 03:59 PM