- Home /
FLYING from Camera Position A to B per Buttom click?
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
Answer by Rafal Sankowski · Apr 13, 2010 at 07:28 PM
You can make animation clip for the camera. It allows you to create not just straight fly from A to B, but you can make move by curves also. The code should look like that:
//create button
if (GUI.Button(Rect (posX, posY, sizeX, sizeY), "fly to other point")) {
//play animation
animation.Play ("fly");
}
If u can't create animation clips, go there - click.
i have got not Unity2.6 only 2.5 whiteout the animationtool. is there another way to Real FLYING?
Answer by Tetrad · May 11, 2010 at 09:57 PM
You could use something like iTween to animate the position of the camera.
Answer by Chapter9 · May 15, 2010 at 05:16 AM
You may want to take a look at this also...
updated link (at least for now): http://answers.unity3d.com/questions/16090/zoom-out-from-first-person-to-third-person.html
Answer by toby · Jul 29, 2011 at 08:55 AM
Hi guy, that animation flying works for me, what about if my Player were in the different coordinate and want to fly from that place to the desire destination? i don't want the Player replay the same clip because the location was change.. xD