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 LUKS123456 · May 14, 2016 at 05:23 PM · rigidbodyinputjumpaxiskeyboard

Jump does not work with diagonal movement.

Hello everyone! I'm trying to do a basic walk and jump script but for some reason my character don't jump when it's moving on diagonals by arrow keys, except up+right.

     if(canMove==true){
         var direction = Vector3(0, Input.GetAxisRaw("Vertical"), Input.GetAxisRaw("Horizontal"));
         GetComponent.<Rigidbody>().transform.Translate(direction * speed * Time.deltaTime);
     }
 
     if (Input.GetButtonDown("Jump")){
         GetComponent.<Rigidbody>().AddForce(new Vector3(0, 5, 0), ForceMode.Impulse);
     }

I read in other threads that this problem may happen for keyboard limitations, but it responds well in other games. Any sugestion?

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

Answer by zeropointblack · Jun 21, 2020 at 12:50 PM

I am having the same problem but using character controller.

I also dont think it has anything to do with keyboard limitations because jump works with other diagonals and all fingers smushed down on all the keys. just not at all when running backwards and or only sometimes on some diagonals. weird huh. probably has something to do with isGrounded...

also, up right, sounds like something to do with positive values vs negative on the movement axes?

debug commencing.

the arrow keys and analog stick work in all directions with jump. WASD keys are not working back left and back right.

ALSO, jump button on controller works with WASD back diagonals. (again, not with space bar.)

possibly because this bit of this code im using? Vector3 move = transform.right x + transform.forward z;

will try changing it. also tried changing around some settings in player input project settings. nothing.

sounds like either windows or unity doesnt like those keys and space bar working together...


confirmed, works just fine on my laptop (minus the god awful performance). must be my ancient logitech USB mini keyboard. bought it decades ago for ps2 FFxi. kept it because its so damned great. whoops. (yep also confirmed space bar does NOT work on web browser when pressing diagonal keys together)

will buy new keyboard ASAP.

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

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Google Cardboard Look Axis are the Opposite. 0 Answers

Ello~ I need help with transform.parent = null; When I play it and press the DropWeapon input button it goes in a random location and doesnt move . 0 Answers

Problem with input axis "Submit" 1 Answer

Character not jumping after switching to new input system 0 Answers

Why unity not working after launching .exe but works when build and run? 0 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