• 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 Nanako · Feb 13, 2015 at 07:04 AM · collisionphysicsrigidbodycontinuous

Rigid body Continuous and ContinuousDynamic seem to do nothing

I'm trying to solve the age old problem. Fast projectile, thin walls = projectile passes through walls without colliding. This is not acceptable in a modern physics engine, i should have tools to deal with this.

My projectile is created in mid air, and then propelled by applying a force to it in the direction of the camera. I'm never using kinematic movement methods.

Enter the collision detection modes, which work as thus (according to documentation)

Use this to set up a Rigidbody's for continuous collision detection, which is used to prevent fast moving objects from passing through other objects without detecting collisions. For best results, set this value to CollisionDetectionMode.ContinuousDynamic for fast moving objects, and for other objects which these need to collide with, set it to CollisionDetectionMode.Continuous. This has a big impact on physics performance, so just leave it set to the default value of CollisionDetectionMode.Discrete, if you don't have any issues with collisions of fast objects. Continuous Collision Detection is only supported for Rigidbodies with Sphere-, Capusle- or BoxColliders. See Also: CollisionDetectionMode.

So i set my projectile as ContinuousDynamic. I set my wall as continuous (i give it a rigidbody, and also make it kinematic). The projectile has a sphere collider, the wall has a box collider. and it still passes clean through at high speeds. What in the hell?

I suppose i could increase the timestep value, but that is an absurd and unscaleable solution to what should be a very simple problem. I could make the wall thicker, or the projectile larger, but those ideas are dumb for the same reason. Continuous/interpolated collision detection is not a complicated feature, a modern physics engine should support this easily. Why isn't it working?

I'm trying to make a game which relies very heavily on a lot of physics and optimisations. I was planning to turn the timestep DOWN for more performance, not up. Turning it up to fix this problem would scale up the load of every aspect.

Comment
Add comment · Show 1
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 Eric5h5 · Feb 13, 2015 at 04:30 PM 0
Share

So i set my projectile as ContinuousDynamic. I set my wall as continuous (i give it a rigidbody, and also make it kinematic). The projectile has a sphere collider, the wall has a box collider. and it still passes clean through at high speeds.

This sounds correct, and I can't see any colliders ever passing through each other with this setup, even at completely insane speeds.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by meat5000 · Feb 13, 2015 at 04:58 PM

On the cube there was a box collider.

I swapped this for a Mesh Collider and Selected Continuous on its Rigidbody.

I was then able to Detect a projectile speed of 1e+10.

(FTS 0.01, MTS 0.33)

I guess this is only half a solution as it doesn't help to shoot enemies in the face; they won't use Mesh Colliders.

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 Nanako · Feb 13, 2015 at 05:24 PM 0
Share

http://forum.unity3d.com/threads/continuous-collision-detection.297909/ hippocoder says unity 5 has some improved behaviour. By any chance do you have access to the beta? i do not ;-;

avatar image meat5000 ♦ · Feb 13, 2015 at 05:28 PM 0
Share

I don't, either.

That'd be quite a step for a problem like this, though.

avatar image meat5000 ♦ · Feb 13, 2015 at 05:30 PM 0
Share

Dug this up though

http://wiki.unity3d.com/index.php?title=DontGoThroughThings

avatar image Eric5h5 · Feb 13, 2015 at 06:43 PM 0
Share

Unity 5 has the same issue. But a mesh collider works. Given that it's a different version of PhysX entirely, it's see$$anonymous$$g more like by design rather than a bug. Either that or it's a very persistent bug. In any case the docs should mention that a mesh collider is required.

You can still use mesh colliders for enemies; just use a convex mesh collider.

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

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

Related Questions

Keep Horizontal Momentum after Jump 2 Answers

Collision.impulse = 0 in OnCollisionStay Kinematic Static collision pair after Update 0 Answers

Ping Pong bat is not detecting the collision with the wall 1 Answer

Why is there no Rigidbody2D.SweepTest() ? 1 Answer

Continuous collision detection - unnatural behaviour 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