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 kickasskane · Jun 07, 2012 at 05:42 PM · y axismouse looklimitsx axis

Mose look no limits

Hello, I have been a unity user for quite a while now and i've been working on a new FPS game and its working great, the only problem is, on one mission the player is sitting inside a helicopter but no matter what he can always do a 360* rotate and I write different numbers of limits and even watched a tutorial and done the EXACT same thing and the guy on the tutorial worked but not mine! I'm using the default unity Mouse Look script and my Y axis works fine, but the X axis won't listen to any of the numbers I write in, Sensitivity amounts are ok its just the "Maximum X and Minimum X". Please help. Thankyou.

-Kickasskane Productions

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 Starwalker · Jun 07, 2012 at 08:02 PM 0
Share

you need to post a code in the problem area, since you know something has worked and its not working for you, its probably code.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Berenger · Jun 07, 2012 at 08:08 PM

This is because X limit wasn't implemented (why ? God knows ...) Here is one I modified few days ago :

 void Update ()
 {
     if (axes == RotationAxes.MouseXAndY)
     {
         rotationX += Input.GetAxis("Mouse X") * sensitivityX;
         rotationX = Mathf.Clamp (rotationX, minimumX, maximumX);
         
         rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
         rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
         
         transform.localEulerAngles = new Vector3(-rotationY, rotationX, 0);
     }
     else if (axes == RotationAxes.MouseX)
     {
         rotationX += Input.GetAxis("Mouse X") * sensitivityX;
         rotationX = Mathf.Clamp (rotationX, minimumX, maximumX);
         
         transform.Rotate(0, rotationX, 0);
     }
     else
     {
         rotationY += Input.GetAxis("Mouse Y") * sensitivityY;
         rotationY = Mathf.Clamp (rotationY, minimumY, maximumY);
         
         transform.localEulerAngles = new Vector3(-rotationY, transform.localEulerAngles.y, 0);
     }
 }
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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

x, y position to 360 degree 0 Answers

How to disable Mouse Look On Pause Menu. 2 Answers

I am trying to change rows and column to x and z 1 Answer

Character to fly in axis X 1 Answer

Locking object (or animation) to X or Y axis 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