Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by cubictoast · Oct 19, 2013 at 11:58 PM · camerajavascript

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.

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image 10001110101 · Oct 20, 2013 at 12:23 AM 1
Share

$$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.

avatar image 10001110101 · Oct 20, 2013 at 12:24 AM 0
Share

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! :)

avatar image cubictoast · Oct 20, 2013 at 06:39 PM 0
Share

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?

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges