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 slkjdfv · Aug 26, 2010 at 02:45 AM · physicsrigidbodycharacterjumping

Rigid body floating the air when I jump at a wall... how do I fix?

Ok I'm using the function OnCollisionStay to check when I'm inconytact with the ground and its working just fine until I jump at a wall. When I do that my character just stays there floating and not falling until I release my move forward key. So I tried using a raycast and that seemed to work but now I cant go up and down stairs. Help please.

Comment
Add comment · Show 2
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 Matt-Downey · Oct 07, 2011 at 07:23 PM 0
Share

I'm having the same issue. Out of curiosity, have you found a way to fix this? I know why it's happening (moving slowly and parallel to the wall doesn't cause "wallriding" but moving straight towards it or at a small angle of incidence and high speed does). I tried to make walls vector reject the player's movement, which didn't work but I only tried it for about a week. If you have any lead that I can follow I'd greatly appreciate it. $$anonymous$$y best guess was to add my own gravity system, which I was planning on doing anyway. (In my editor, wall riding happens despite gravity being enabled and y-velocity not being set to zero every frame.)

avatar image Matt-Downey · Oct 07, 2011 at 07:27 PM 0
Share

Another key part, I check for the y-component of the normal vector. I group objects into walls, ceiling and floor based on whether y is in the -0.05 < x && x < 0.05 range, x >= 0.05 range, or x

2 Replies

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

Answer by StephanK · Aug 26, 2010 at 07:02 AM

You are not saying what you are doing in OnCollisionStay(), but I guess you are just checking for any collision and treat this as grounded. If you tag your ground you can just check if the collision is with the ground or something else (wall, enemy etc.) and only set grounded = true if the you're colliding with the ground.

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 BurningThumb · Aug 26, 2010 at 05:15 AM

  • Use a rigid body based character controller and make your walls a little bouncy.

or

  • Create a collision area around you stairs, that disables you anti-wall jumping logic OnCollisionStay()
  • Create a small waiting period between when the forward direction is applied to your character controller, so you player progressively falls down, do not allow jump unless character controller is on the ground.

The exact details will vary based on the specifics of your game, if you try to be more specific about your raycast logic, and what you are trying to achieve it would help narrow down the correct solution.

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

1 Person is following this question.

avatar image

Related Questions

Make rigidbody walk like character controller 6 Answers

How do I make a rigidbody move on command (ie A Player Character)? 1 Answer

Preventing rigidbodys from jumping on a tiled map 0 Answers

Character Controller Jittering 0 Answers

How to prevent friction for character along vertical surfaces? 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