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 Austin 3 · Dec 09, 2010 at 07:25 AM · inputkeyvolumegetkey

Very wierd issue with right arrow key

So I have a script right now that just edits the volume. When you hold the left key, the volume is lowered. When you hold the right key, the volume is suppose to be raised, but it only raises the volume for maybe 1 second or two and the stops. I then have to lift my finger from the key and repress and it will do it again. I changed the key to "k" to see if it was an issue with the logic and it isn't, the other key raised the volume fine without stopping.

if (Input.GetKey("right") || (Input.GetAxis("Horizontal") == -1 && mainMenu.time > delta)) { changesMade = true; mainMenu.time = 0.0f; if (barPosition == numOptions) barPosition += 1;

         if (barPosition == 0)
             STM.mainLoop.volume += 0.005F;
     }

If anyone has any ideas please toss them out.

EDIT: The problem is only with the key input, the controller works fine.

Thanks! - Austin

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

3 Replies

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

Answer by Austin 3 · Dec 14, 2010 at 08:19 AM

Okay, I figured out the problem. I was looking at two different inputs to carry out some logic in the if statement, right? Well, "Horizontal", I had forgotten, also takes in keystrokes so it was clashing with the "right" and "left" checks; that is why all the weird stuff was happening. I've gotten rid of the first check (Input.GetKey("right") and "left") and I'm just using the Input Manager. Thanks all for your ideas/help, I really do appreciate it.

  • Austin

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

Answer by BerggreenDK · Dec 09, 2010 at 07:30 AM

Perhaps your input settings for controls needs ajustment. You might need a better sensiblity or deadzone.

Show us a bit of your code, if you think is a problem with the actual algorithm. Descriping the problem without showing the reason makes it harder to understand and help you.

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

Answer by diabloroxx · Dec 13, 2010 at 09:57 PM

 if (Input.GetKey("right"))
          Debug.Log("right pressed");

This keeps working perfectly when inside the Update(). Check your code or perhaps, the Input. Maybe you have another Camera/Controller attached to the "Right" key which is disabling it from Multiple presses.

Comment
Add comment · Show 2 · 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 Austin 3 · Dec 14, 2010 at 06:42 AM 0
Share

I justed changed ST$$anonymous$$.mainLoop.volume += 0.005f; to -= and kept the input key as "right" and it works perfectly. I have no idea what the problem is.

avatar image Austin 3 · Dec 14, 2010 at 06:44 AM 0
Share

AND, sorry for spam$$anonymous$$g, I just swapped my code for the "left" input (which lowers the volume) with "right" and change the "right" input check to left and it's working fine also!

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

No one has followed this question yet.

Related Questions

How to get the key from the button name 1 Answer

Key remapping inGame 0 Answers

how can i use getkey and getkeydown for two diffrent functions. 2 Answers

replace Input.GetKey for mobile input 1 Answer

Only KeyPress once? 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