Shifting main camera view for 3d menues.

Hey all!

I’m having a heck of a time figuring out how to script my 3d button to shift the main camera when I click a button so that it can show another menu.

I was thinking that the best way to do it would be to have a camera position variable set to 0 by default and then change the value on the buttons then have a camera script that moves it. That way I can add more menus along the way easily and jump from any menu to any other menu on the fly.

Does that sound about right?

Also, any recommendations on how I can have it slide and not just teleport?

Thanks!

Oh, and if anyone can recommend a good tutorial for this I would appreciate it.

Your idea sounds OK but as to being best or not it’s impossible to tell. If it works and does what you need then it’s OK in my book.

To slide instead of teleport check out the Lerp function…

http://docs.unity3d.com/Documentation/ScriptReference/Vector3.Lerp.html

Good luck.

That looks exactly like what im looking for. Thank you.