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 archaismic · Feb 06, 2013 at 06:05 AM · movementinstantiateinputfirst-person-controllergetbuttondown

Inputs cutting eachother out

Here's the code

 var bulletPrefab:Transform;


function Update () {

 if(Input.GetButtonDown("Fire Up"))
 {
     var upBullet=Instantiate(bulletPrefab, GameObject.Find("spawnUp").transform.position,Quaternion.identity);
 }
 if(Input.GetButtonDown("Fire Right"))
 {
     var rightBullet=Instantiate(bulletPrefab, GameObject.Find("spawnRight").transform.position,Quaternion.identity);
 }
 if(Input.GetButtonDown("Fire Left"))
 {
     var leftBullet=Instantiate(bulletPrefab, GameObject.Find("spawnLeft").transform.position,Quaternion.identity);
 }
 if(Input.GetButtonDown("Fire Down"))
 {
     var downBullet=Instantiate(bulletPrefab, GameObject.Find("spawnDown").transform.position,Quaternion.identity);
 }



all the buttons work, it instantiates everything correctly under any single direction move or stationary HOWEVER... sometimes they wont work when moving diaganoly (two motion inputs going at once)

ie right fire wont work if im also going up and right down and left fire wont work if im also going down and to the left etc

I'm using the standard first person controller that comes with unity4

I've turned on and off the platform follow, jump, and slide.

I already checked to make sure there weren't overlapping key inputs or something

I already checked to make sure the spawn points weren't too close to the character input thingy and causeing some weird collision issue

I don't know what else to look at

Comment
Add comment · Show 8
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 robertbu · Feb 06, 2013 at 06:35 AM 0
Share

I'm not sure this has anything to do with your problem, but note that GetButtonDown() only returns true during the single frame the button is pressed, and will not return true again until the key released and repressed. Your ti$$anonymous$$g will vary a bit, so sometimes both will go down in the same frame, sometimes they will go down in separate frames.

avatar image archaismic · Feb 06, 2013 at 07:13 AM 0
Share

yeah i know that part... like if you press to many buttons the OS will start cutting them out etc... but it works when im shooting right and going down and to the left... but not up and to the right... it doesn't make sense... very confused

avatar image barinelg · Feb 06, 2013 at 07:32 AM 0
Share

This may be a farfetched idea, but have you tried other keyboards or input devices? The only thing that comes to $$anonymous$$d for me is that on some keyboards, there's a cap to how many keys you can press in a certain group. For instance, a non-ga$$anonymous$$g keyboard may only allow 2 of QWEASD to be pressed at a time, making it seem like the game isn't accepting the input. This generally varies on a per keyboard basis, I think.

avatar image archaismic · Feb 06, 2013 at 07:34 AM 0
Share

hmmm.... that would be... annoying

avatar image archaismic · Feb 06, 2013 at 07:37 AM 0
Share

http://www.razerzone.com/ga$$anonymous$$g-keyboards-keypads/razer-lycosa

that's what I'm using... im PRETTY sure it can handle 3-4 keys at once... though i have no idea how to find out

Show more comments

1 Reply

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

Answer by barinelg · Feb 06, 2013 at 02:58 PM

The problem is the number of keys that were being pressed at one time. Some keyboards have a limit on the total number of keys pressed, and some have limits on the total number of keys pressed in a certain group. Keyboards specifically made for gaming tend to allow more keys to be pressed than a normal keyboard, but can still have limitations. When you hit the cap, it will appear as if the game isn't accepting the input or ignoring it, where in fact the hardware is not registering the keys pressed after the limit was reached. A good way to check is to use a keyboard tester (such as one here) and see if the keys assigned in your game are all showing up and not being cut off by the keyboard itself.

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

10 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

Related Questions

moving is all messed up 1 Answer

Make First Person Controller More Sensitive 0 Answers

Smooth movement help? 1 Answer

Instantiate transformation? 2 Answers

Movement with AddForce: Wrong Direction 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