• 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
2
Question by Andy-Block · Apr 15, 2013 at 08:18 PM · physicsterrainrolling

Unrealistic physics - ball rolling up steep hill

I have a problem with a physics simulation, where a rolling ball on a terrain is very unrealistic in places, most especially at the bottom of very steep hills. The ball inexplicably 'climbs' such walls. I have illustrated the problem with a web player at https://dl.dropboxusercontent.com/u/7590839/UnityWebPlayers/PhysicsProblem/webplayer.html. The compressed project can be downlaoded at https://dl.dropboxusercontent.com/u/7590839/UnityWebPlayers/PhysicsProblem/physics-problem.zip.

The only objects in the physics world are a simple ball and a terrain. When started, StartScript (which is attached to the main camera) gives the ball a kick with AddForce. The ball starts rolling realistically, but when it hits the steep bank in the terrain it behaves very unrealistically (I have seen it climb significantly higher that in the sample). Behaviour on a less steep bank is usually okay. Other similarly unrealistic effects can also be observed (in particular, a near-stationary ball failing to roll down a slope that it looks like it should).

It seems a little like normals of the terrain have not been calculated correctly, or are not being used correctly in the physics sim (although using terrainData.GetSteepness or terrainData.GetInterpolatedNormal appear to give sensible values).

The shader used in this project is the one from http://docs.unity3d.com/Documentation/Manual/ShaderTut2.html, to help get an idea of the normals the rendering code is working with. They look right to me.

I have seen some similar issues reported, but the suggested solutions I have found have not helped me to resolve my problem. I have filed a bug report for this issue, but was hoping someone in the community might be able suggest a workaround or help in some other way? Thanks in advance,

  Andy
Comment
Add comment · Show 6
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 Dracorat · Apr 15, 2013 at 08:26 PM 0
Share

It seems like either gravity is too light or the mass of the object is too large (larger mass means more force [like gravity] required to stop the object).

Also, thanks for posting a well formulated question with an example. TU for you.

avatar image Owen-Reynolds · Apr 15, 2013 at 09:24 PM 0
Share

$$anonymous$$ass only matters when hitting another rigid body (in real life, mass/density sort of reduces drag. In Unity you set drag directly.)

But too large an object would do it for sure. A radius 10 sphere is an enormous boulder, and visually will appear to "float" more.

avatar image Andy-Block · Apr 15, 2013 at 09:56 PM 0
Share

Thanks for your suggestions!

I've tried playing a fair bit with all of the physics settings (and with the physics materials), and the scale of the environment as a whole, but with no joy. The project I posted has gravity set a little lighter than normal (-6), as the standard setting of -9.8 felt rather too strong when you see the ball dropping (which you don't in the sample I posted). But Setting gravity back to -9.8 shows exactly the same behaviour with the uphill rolling. Setting it to -50 introduces a heavy 'bouncing vibration', where the ball never settles into a proper roll; however, the same climbing behaviour is apparent. At -100 the vibration seems to have do$$anonymous$$ated everything, and the ball never reaches the wall, presumably because of the loss of energy through friction from the repeated collisions.

Increasing the mass of the ball from 1 to 5 seems to have a disproportionate effect on the force required to move the ball, for some reason (I increased the force being applied from 70 to 700000, and the ball still refuses to shift fast enough to allow it to reach the incline!). This doesn't match what I would naively expect from F=ma. I guess it's got something to do with friction. Turning friction off in the physics material gets it rolling nicely, though, but the unwanted effect when it reaches the incline is even more pronounced :( .

Thanks again for the thoughts, though.

avatar image Andy-Block · Apr 16, 2013 at 06:13 PM 0
Share

For anyone who's interested, the Unity $$anonymous$$m have acknowledged that this is a bug which they can reproduce and say they are looking into, but can't yet say when the resolution will be available.

avatar image Dracorat · Apr 16, 2013 at 06:21 PM 0
Share

Good to know - thanks - make sure to post back if you get some other follow up about it.

Show more comments

1 Reply

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

Answer by Andy-Block · Apr 16, 2013 at 07:20 PM

The Unity team have acknowledged that this is a bug (case 537745) which they can reproduce and say they are looking into, but can't yet say when the resolution will be available.

Comment
Add comment · Show 4 · 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 timinOz · Aug 01, 2014 at 12:41 PM 0
Share

Sorry to dredge up an old post, but was this issue ever resolved? I can't find any sign of the bug report in issue tracker and I'm experiencing the same behaviour. Switching my character from a capsule to a box collider stopped the player sliding up, but spheres moving purely under unity physics will slide up slopes if they are very steep. The threshold steepness looks to be about 80 degrees, on lesser slopes in the same terrain everything behaves as expected.

avatar image Andy-Block · Aug 03, 2014 at 07:31 PM 0
Share

I checked on the state of the case recently and noticed it had been closed. When I inquired about it, I was informed as follows:

$$anonymous$$y apologies for not notifying you about the case. This issue has been fixed in the 5.x cycle where we will update to PhysX 3.3 which will also fix a number of other issues. You can find more about it by visiting our blog http://blogs.unity3d.com/2014/07/08/high-performance-physics-in-unity-5/.

Hope that helps!

avatar image timinOz · Aug 11, 2014 at 05:13 AM 0
Share

Thanks Andy, good to know. I'll just have to hope they get 5.x out before I finish this thing then!

avatar image martipello · Feb 08, 2016 at 08:16 PM 0
Share

Was this actually resolved? Using 5.3 experiencing same issue

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

Invisible paint details in scene mode 0 Answers

Terrain Friction - ball on terrain?? 1 Answer

Trying to use colliders on trees to interact with player 1 Answer

car moving up and down rapidly as soon as it hits the terrain 1 Answer

How do i prevent an imported Mesh from falling through Terrain? 3 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