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 SomeGuy22 · May 27, 2013 at 06:48 PM · collisionrigidbodyplayermecanimstuck

Rigidbody gets stuck on wall?

I have a mecanim-controlled character with a rigidbody attached. The character moves using Root Motion from the Animator. When the character jumps and hits a wall, he gets stuck. I've heard this problem has happened before with RigidbodyWalker scripts but I haven't been able to find a solution.

Is there a way to ensure the player doesn't get stuck floating in a wall after jumping?

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 · May 27, 2013 at 07:25 PM 0
Share

In a similar question, the issue was that the rigidbody went to sleep. This is unlikely to be your issue, but it is easy to check. Put a Debug.Log(rigidbody.isSleeping) in the code and duplicate the wall sticking behavior.

avatar image SomeGuy22 · May 27, 2013 at 07:47 PM 0
Share

No... could it be due to the fact that the root animation is moving him forward?

avatar image clunk47 · May 27, 2013 at 07:48 PM 2
Share

Do you have the box checked in the inspector "Animate Physics"?

avatar image SomeGuy22 clunk47 · May 27, 2013 at 08:46 PM 0
Share

Yes I do. Seems to be he's partially embedded in the wall, which means the root animation probably shoved him a little too far... Is there a way to stop that from happening? Also it only happens when the player is in the air...

avatar image clunk47 clunk47 · May 27, 2013 at 09:26 PM 0
Share

Try placing a new, bigger collider around your character, make that collider a trigger. Use something like OnTriggerEnter reacting to the tag "Wall", or whatever he will be colliding with. Not sure if this will help because I'm not too experienced w/ animation. But I would try this, and set the trigger script to either push your character back out of the wall, or slow his velocity, or increase the rigidbody drag while moving in air toward the wall...

avatar image SomeGuy22 clunk47 · May 27, 2013 at 10:03 PM 0
Share

That seems kind of tedious because it's supposed to be an automated system... I tried using OnCollisionEnter and OnCollisionStay with AddForce to use force to push the character out of the wall but that doesn't work either... There has to be some kind of option that stops root animations from going through colliders...

Show more comments

1 Reply

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

Answer by SomeGuy22 · May 28, 2013 at 12:16 AM

"Alright so apparently changing the mass of the rigidbody to 1 fixes this and causes him to collide properly. I have no idea why this solved it and I would like to set the mass back to a more realistic value but if anyone has any idea on why changing the mass fixes this I'd be glad to hear it :P"

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

14 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

Related Questions

RigidBody stuck on wall when jumped against 7 Answers

Player falling through the floor 1 Answer

Collision If Statement And Falling throught the ground (2 questions) 1 Answer

Rigidbody stuck in colliders when moving and ricosheting. 0 Answers

Why is my kinematic Rigidbody stuck? 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