Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by JonK · Jul 23, 2013 at 03:11 AM · movementinputinputmanagerkeyboard input

Holding Ctrl prevents character from moving

When I hold down the left control key then press press W,A,S or D nothing happens but if I press it after I press and hold W,A,S or D it works properly.

WASD move the character and left control is set to make the character crouch and move slower. All of this is setup in the InputManager.

I tried commenting out code that I wrote that is affected by the ctrl key and nothing changed.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by robertbu · Jul 23, 2013 at 05:37 AM

It looks like the issue is inherent in the Input Manager. Work arounds use Input.GetKey() to hard code the logic rather than use the Input Manager.

http://answers.unity3d.com/questions/173836/combined-keys-action.html

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 JonK · Aug 01, 2013 at 01:26 AM 0
Share

I tried using Get$$anonymous$$ey and still having the same results. But I used Get$$anonymous$$ey with E and it worked fine. Seems the be a problem with the control key.

avatar image robertbu · Aug 01, 2013 at 04:32 AM 0
Share

I'm not clear and exactly how you want the keys structured, but here is a bit of code as an example of capturing the control keys. Attach it to an empty game object and play with combinations of 'Ctrl' and 'W':

 #pragma strict
 
 var bCrouchAndSlow = false;
 
 function Update() {
     var leftCtrl  = Input.Get$$anonymous$$ey($$anonymous$$eyCode.LeftControl );
     var rightCtrl = Input.Get$$anonymous$$ey($$anonymous$$eyCode.RightControl);
     bCrouchAndSlow = leftCtrl || rightCtrl;
     
     if (Input.Get$$anonymous$$ey($$anonymous$$eyCode.W)) {
         if (bCrouchAndSlow)
             Debug.Log("$$anonymous$$oving forward crouching and and slowly");
         else
             Debug.Log("$$anonymous$$oving forward upright and quickly");
     }
 }
avatar image
0

Answer by superdudeman · Mar 04, 2015 at 08:38 PM

I'm having the exact same problem and am surprised there aren't more complaints about it! Anyway it only seems to be an issue in the Unity editor. When building and running it, it stops happening. I guess the Unity editor is listening for the left ctrl key.

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

17 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

Related Questions

Set Alt Positive/Negative Button input during runtime 0 Answers

how can I assign and use different controller schemes for a single keyboard? 0 Answers

Is there a way to assign multiple set control schemes to gameobjects at run time for local multiplayer keyboard controls? 0 Answers

Horizontal/Vertical input immediately zero after key release 1 Answer

Shooting in direction of the character movement 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