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 FLASHDENMARK · Jul 18, 2012 at 10:34 PM · sensitivityaccuracy360 controller

Inaccuracy of the Xbox 360 Controller

I have for some time now been developing a First Person Shooter. I love playing on the Xbox 360 so naturally I wan't to play the game using a 360 Controller.

All of the functionalities works on the PC and the 360 controller alike, except one thing; aiming.

Well it works how it is supposed to, but due to the inaccuracy of the thumb compared to the hand/arm used in conjunction with the mouse, aiming is really difficult on the controller. Using the mouse while aiming is fairly easy, but using the Xbox controller I can't aim even if my life depended on it.

As said before I am aware of the inaccuracy using the analog sticks and I have compensated for that by lowering the sensitivity. However even with a fairly low sensitivity aiming is still pretty hard. And with the low sensitivity it takes almost 10 seconds turning 360 degrees, which is not feasible.

I booted up Halo 2 where aiming is near perfect. Halo 2 rotates the player by a linear value just as my game does. I noticed that the rotation on the Y axis was considerably quicker than the rotation on the X axis. So I though I would lower the sensitivity on the X axis, however no dice. It is almost impossible to aim using the controller.

It is not that I am not used to using a 360 controller. I have been using that thing on the Xbox 360 for many years. So inexperience/unfamiliarity using the controller is not a problem either.

I have this code here which is pretty much the standard MouseLook, but modified to take input from both the mouse and the 360 controller.

 #pragma strict
 
 @System.NonSerialized
 var rotate = true;
 
 var useMouseInput = false;
 
 enum RotationAxes{MouseXAndY = 0, MouseX = 1, MouseY = 2}
 var rotationAxes = RotationAxes.MouseXAndY;
 static var sensitivity : float = 75.0;
 
 var sensitivityYProcentage = 50; //The procentage that rotationY is less than rotationX
 
 var minimumX = -360.0;
 var maximumX = 360.0;
 
 var minimumY = -85.0;
 var maximumY = 90.0;
 
 var rotationX : float;
 var rotationY : float;
 
 private var originalRotation : Quaternion;
 
 function Start (){
     if (rigidbody)
         rigidbody.freezeRotation = true;
 
     originalRotation = transform.localRotation;
 }
 
 function Update () {
     if(Time.timeScale == 1 && rotate){
         var rotX : float;
         var rotY : float;
 
         if(!useMouseInput){
             rotX = Input.GetAxis("Right Horizontal") * sensitivity * Time.deltaTime;
             rotY = Input.GetAxis("Right Vertical") * ((sensitivity / 100) * sensitivityYProcentage) * Time.deltaTime;
         }else{
             rotX = Input.GetAxis("Mouse X") * sensitivity * Time.deltaTime;
             rotY = Input.GetAxis("Mouse Y") * ((sensitivity / 100) * sensitivityYProcentage) * Time.deltaTime;
         }
 
         if(rotationAxes == RotationAxes.MouseXAndY){
             rotationX += rotX;
             rotationY += rotY;
 
             rotationX = ClampAngle (rotationX, minimumX, maximumX);
             rotationY = ClampAngle (rotationY, minimumY, maximumY);
 
             var xQuaternion : Quaternion = Quaternion.AngleAxis (rotationX, Vector3.up);
             var yQuaternion : Quaternion = Quaternion.AngleAxis (rotationY, Vector3.left);
 
             transform.localRotation = originalRotation * xQuaternion * yQuaternion;
         }else if(rotationAxes == RotationAxes.MouseX){
             rotationX += rotX;
             rotationX = ClampAngle(rotationX, minimumX, maximumX);
 
             xQuaternion = Quaternion.AngleAxis(rotationX, Vector3.up);
             transform.localRotation = originalRotation * xQuaternion;
         }else{
             rotationY += rotY;
             rotationY = ClampAngle(rotationY, minimumY, maximumY);
 
             yQuaternion = Quaternion.AngleAxis(rotationY, Vector3.left);
             transform.localRotation = originalRotation * yQuaternion;
         }
     }
 }
 
 public static function ClampAngle (angle : float,min : float,max : float){
     if (angle < -360F)
         angle += 360F;
     if (angle > 360F)
         angle -= 360F;
 
     return Mathf.Clamp (angle, min, max);
 }

Hopefully you'll manage to get through the wall of text and hopefully answer my question.

Thank you.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Nsmurf · Jul 19, 2012 at 12:56 AM

I have not used a 360, so i do not know if this would work, but have you tried to make the turning have velocity? i mean to have it so at first it's slow but then speeds more if you hold the joystick longer.

Comment
Add comment · Show 1 · 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
avatar image FLASHDENMARK · Jul 19, 2012 at 04:03 PM 0
Share

Well, I changed the dead zone in the input settings and that really helped out. And I implemented a aim smoothing system that does help out a little as well.

Thanks.

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

How to give your enemy gun inaccuracy 1 Answer

SphereCast inaccurate? 0 Answers

Jump Input Sensitivity 0 Answers

Changing input sensitivity via scripting (JS) 1 Answer

Delta time not accurate enough.. What should I do? 4 Answers


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