x


Klick a Button to Fly from A to B.

How can i make change the First Person or Camera position by clicking a Buttom?

In other words, With Which GUI-JavaScript command can I change my First Person or Camera View position, With a click on a button? I want to Fly from position A to position B

Thank you

more ▼

asked Mar 31 '10 at 03:35 PM

One-Unity-One-World gravatar image

One-Unity-One-World
1 2 2 2

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

1 answer: sort voted first

Try this:

function OnGUI () {
    if (GUI.Button (Rect (10,10,150,100), "I am a button")) {
        transform.Translate (0,10,0);
    }
}

That will move your camera from point a to point b instantaneously. All you have to do is put it on your camera. On the press of a button, it will move from where it is now to wherever you specify in this line:

transform.Translate (0,10,0);.

Hope this helps!

more ▼

answered Mar 31 '10 at 05:25 PM

e.bonneville gravatar image

e.bonneville
5.7k 100 116 165

Very Good Works!

Apr 01 '10 at 09:18 AM Flash-Unity3D

But do not Fly, but Beam. How can FLYING from A to B?

Apr 13 '10 at 05:55 PM flashtech
(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:

x5099
x3698
x3015
x52

asked: Mar 31 '10 at 03:35 PM

Seen: 1222 times

Last Updated: Mar 31 '10 at 03:35 PM