Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by OrelUnity · Oct 25, 2017 at 08:07 PM · joystick

Bad values for joystick input in unity 5

Hi,

I have a "noname" USB joystick and I try to use it in a Unity project. The buttons are working fine, but I have troubles with axis values.

According to Unity5 documention, for each axis, I should get values :

  • -1.0 when the axis is pushed to the "minimum" (left for X axis or down for Y axis)

  1. when the axis is at center

  • +1.0 when the axis is pushed to the "maximum" (right for X axis or up for Y axis)

But I get :

  • -1.0 when the axis is at center

  1. when the axis is halfway between center and maximum

  • +1.0 when the axis is pushed to the "maximum" (right for X axis or up for Y

  • +1.0 if the axis is pushed at any position below center

I really don't understand why I get these values :

  • when I display the windows joystick calibration UI (run "joy.cpl") the joystick is working fine.

  • when I use an existent game, the joystick is working fine

  • I tried some joystick test programs found on the internet, each time the joystick is working fine

  • I tried some HTML5 joystick test sites, each time the joystick is working fine

But I can't believe there is such a problem in Unity5, so it must be in my code...

Here is a simple test code I use in Unity to display values :

 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;

 public class JoystickTest : MonoBehaviour
 {
     public float Position            = 0.0f;

     void Update()
     {
         float value = Input.GetAxis("Player 1");
         Position = value;
     }
 }

And the Unity input manager is configured as follow :

alt text

I've tried to play with input manager settings, with windows joystick settings, with my code... no way, the result is still the same : work in any application except in my Unity test project...

On Google, I've found some post about the same problem, but no solution...

Any help will be really appreciated !

Thanks

sans-titre.png (15.5 kB)
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

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

118 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 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 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 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 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 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

Single Stick Controller Resets on Game Play 1 Answer

Player i spining when moving 0 Answers

how to map joystick for mobile game? 0 Answers

How to check if player is rapidly rotating the joystick? 2 Answers

Unity Photon WASD working but Virtual Joystick won't work after another player has joined the network...? How can i sync joystick. 2 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