- Home /
Script for a Camera Rotation On the Main Menu
In my current build, I have a Main Menu Screen Level with 3 options, Start, Quit, and Controls. Currently, the Start and Quit buttons work as they are supposed to; OnMouseDown, it either exits the application or loads the first level respectively.
**Link to Screenshot*: http://is.gd/nBQy0Q*
However, I was wondering how to write a script that will rotate the camera a certain number of degrees when the Controls tab is clicked to reveal a list of controls within the same scene, without having to make a new level to jump to. I know that for a smooth transition, I'll need something called a "MathF" command, but from there, how do I write a script to make the camera rotate?
EDIT: Also, I need another "Back" button to send me back to the main screen by rotating in the opposite direction after viewing the controls screen.
$$anonymous$$ath is fun! I can give you a couple of hints! You're going to be doing a 3D rotation and possible translation on the camera itself. What I typically do, is put an empty game object in space then use the forward axis of that object as a target, then slerp to it.
Another thing I like to do is to emulate what I'm trying to do in real life with two objects and try to engineer a bunch of different ways to achieve the result I'm looking for! :)
Thanks for the help so far, but I fear now I'm more confused than before. How is it possible to set the axis of an object as a target, and what does it mean to slerp to something?
Your answer
Follow this Question
Related Questions
I need help with camera movement and rotation. 1 Answer
Camera movement(I have no clue how to code) 0 Answers
How can I set a following camera which doesn't rotate with the object 1 Answer
How do i on the y axis my camera from moving? 0 Answers
Help with understanding and modifying a camera script (JavaScript) 1 Answer