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
1
Question by jeff2365 · Jan 18, 2012 at 02:55 AM · collisionmovementphysicsplayerjump

Sphere get stuck in floor and fails to jump?

I have a rigid body with a sphere collider sitting on a floor. It has this in fixed update:

 if (Input.GetKeyDown(KeyCode.Space))
 {
     rigidbody.velocity = Vector3.up * 4;
 }

If I try to jump as soon as the sphere reaches the floor, it will occasionally fail to jump (remains stationary). Since I am setting velocity directly instead of incrementing it, I know it isn't being cancelled out by any existing negative velocity. Also, I don't have any logic to ensure that the player is on the ground before letting them jump, so that's not the problem either.

Any thoughts on how to fix this? Thanks.

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 ByteSheep · Jan 18, 2012 at 03:11 AM 0
Share

Doubt this is the problem but usually Input gets checked in the normal update function..

avatar image jeff2365 · Jan 18, 2012 at 03:55 AM 0
Share

Nope, that doesn't fix it, but thanks, I'll keep that in $$anonymous$$d.

avatar image ByteSheep · Jan 18, 2012 at 03:57 AM 0
Share

So if the sphere is in the air it will always move upwards but if it is touching the ground it sometimes fails to move?

avatar image wenhua · Jan 18, 2012 at 04:03 AM 0
Share

Under Detonator,explosion effects. will cause object jump, dunno if it does help to you as you can check it up

avatar image ByteSheep · Jan 18, 2012 at 04:08 AM 0
Share

Hey wenhua, answered your question http://answers.unity3d.com/questions/206791/how-to-make-a-sphereball-blinking.html I'm curious to find out whether it works xD

Show more comments

1 Reply

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

Answer by ByteSheep · Jan 20, 2012 at 05:55 PM

For anyone else with this problem make sure to check for input in the regular Update() function and not in the fixed update function :)

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Keep Horizontal Momentum after Jump 2 Answers

Player object falling through game environment, collision not detected with ground 0 Answers

How can I make a physics object jump a given height on collision regardless of current velocity? 1 Answer

Collisions causing Rigidbody to go Haywire and move randomly. 1 Answer

Issues Making Character Move With Rigidbody 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