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 BigText · Apr 19, 2014 at 12:58 AM · cameramouselookspacecamera-lookspaceship

Mouselook in space, without a 'down' or 'up'

I'm planning to make a game that allows you to fly around in outer space, and it's important for the 'space' feel that there is no 'down' or 'up'. For example, in a standard FPS on the ground, when you look all the way up, your character can't look up any further. On top of that, if you move the mouse to the side, your character spins around but is still aiming at the same point, directly above him.

I need to make a camera that, even if you're looking straight 'up' from the original orientation, moving the mouse to the left makes your aim move to the left exactly the same way as if you were turning left while aiming at the horizon in a standard FPS. This would result in your view of the "world" (outer space) becoming tilted, but that's the point. Also, there shouldn't be anything stopping the camera from tilting 'up' so far that it flips over altogether.

Can anyone give me advice on how to implement such a camera?

Comment
Add comment · Show 1
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 robertbu · Apr 19, 2014 at 01:24 AM 0
Share

With an arbitrary frame of reference, you will have a real problem making the movements be intuitive. For example say you don't play any limits so that there is nothing stopping the camera from flipping over. As the camera rotates over the top, your movements become reversed. That is, code moving your cursor up, now moves the camera down. For most situations, this is really disconcerting for users, and it may not be easily fixed.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by grahnzz · Apr 19, 2014 at 01:53 AM

reference the local axes instead of world

 //rotate around local y.
 this.transform.Rotate(Vector3.up,Input.GetAxis("Mouse X"),Space.Self);
 //rotate around local x;
 this.transform.Rotate(Vector3.right,-Input.GetAxis("Mouse Y"),Space.Self);

feels pretty weird

Comment
Add comment · Share
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

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

21 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 avatar image avatar image avatar image avatar image avatar image

Related Questions

Why wont my camera controller work,Why isnt my script working for a camera controller? 1 Answer

First Person Camera switch to Third Person Camera on Object 2 Answers

Restrict Scaling of Object due to camera position and angle. 1 Answer

Problem with mouse look and second skybox cam 0 Answers

Resetting Camera with a key input 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