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 $$anonymous$$ · Oct 09, 2013 at 04:17 PM · physicsrigidbodybounce

Click to Move RigidBody Bouncing

Hi,

I'm trying to tidy up my controller script and I'll try and explain the issue best I can or I'll post a video if no luck. When I click my character to go down a flight of stairs (mesh collider to terrain collider at the bottom of the stairs), he bounces down, get's to the bottom and bounces back and forth until you click again to move him. What's included:

A rigidbody set up with X,Y,Z rotation frozen. A capsule colider around the main character. A piece of script on void (Start) setting the amount of gravity:

Physics.gravity = new Vector3(0,-285f,0);

Raycast on input, location of transform from source to destination. Legacy animations using animation.crossfade from idle to run.

That' all there is to it.

What I have tried:

Removing Physics.Gravity and playing around with the Vector3 variables Changing the Mass, Angular Drag, Drag.. Adding a plane just on top of the stairs, (Cube element with Box collider)

Comment
Add comment · Show 5
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 $$anonymous$$ · Oct 09, 2013 at 04:27 PM 0
Share

Yes that's right, sorry either a mesh collider (Stairs) (As said tried a box collider too), or terrain collider when it get's stuck bouncing on the floor.

avatar image Tomer-Barkan · Oct 09, 2013 at 05:09 PM 0
Share

Not sure I understand the scenario 100%, but did you check for bounciness of physics materials?

avatar image $$anonymous$$ · Oct 09, 2013 at 05:24 PM 0
Share

Added a video: link text

avatar image Tomer-Barkan · Oct 09, 2013 at 07:50 PM 0
Share

Weird indeed. $$anonymous$$y guess would be the colliders are not neatly enough aligned, there might be a small part of the colliders colliding with your character, and since the rotation is frozen, it behaves weird. Try unfreezing the rotation, just to see how the behavior changes. Also, you might want to share the editor view with the colliders visible.

avatar image $$anonymous$$ · Oct 10, 2013 at 12:14 AM 0
Share

I'd love to say it is, checked exactly what you said.. played around with it for hours.. It happens on raised terrain as well, it's not limited to stairs.. I tried the character controller and it works ok, now I need to find out how to do click to move with a Character controller.

2 Replies

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

Answer by $$anonymous$$ · Oct 11, 2013 at 02:17 AM

I had to switch to a character controller which was harder than expected, there is a long and painful way to resolve it with a Rigidbody.

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 theUndeadEmo · Oct 09, 2013 at 04:25 PM

with the information you've provided so far i am going to assume your rigid body collider is intersecting with another collier. (when a collider that has a rigidbody on intersects/ goes inside a bit with another collider, the rigidbody attempts to push itself out)

Comment
Add comment · Show 1 · 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 $$anonymous$$ · Oct 09, 2013 at 04:54 PM 0
Share

Thanks, any ideas on what to do about it?

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

16 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 avatar image avatar image

Related Questions

RIGIDBODY HOW MAKE IT STOP BOUNCING HELP! 3 Answers

How could I make a bouncy object move mostly along the Z axis? 1 Answer

Re-Creating Unity's Friction and Bounce 0 Answers

Avoid bouncing when ground move down 1 Answer

How to calculate a RigidBody2D's bounce from a collider? 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