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 Uberwolfe · Oct 16, 2013 at 09:11 AM · collisionphysicsrigidbodyterrainprojectile

Innacurate terrain collision with fast rigidbody

Hello! Before I detail my question, please know that I am mostly aware of the collision-caveats associated with very fast rigidbody collisions and that it's generally not a good idea, but I need projectiles that behave in a realistic manner (ie, air drag and bullet-drop etc etc) - insta-hit raycast bullets are not an option. Unfortunately I don't have time (nor the mathematical alacrity!) to completely write my own projectile physics system

I am simulating projectiles solely with the physics engine and have projectiles at speeds between 50,000 - 100,000. Now everything works perfectly (really) with collisions on meshes with a variety of colliders.

The only innaccurate collisions I can detect are on the Unity terrain colliders.

While no bullet misses per se, the bullet impact points are always slightly further ahead then they should be. The effect is increased the faster the projectile is set. At 50,000 (the speed of my tank shell) it's not too bad, but at 100,000 (the speed of my bullets) the impact points are usually about 10 feet ahead of where they should be.

Using trail renderers to try and debug the problem it shows that the bullet is actually hitting where it should be, but then kind of entering the terrain and bouncing out further ahead, and that point further ahead is where the collision physically registers. SO my impact effects always look way off.

The image below illustrates the problem. The line indicates where the bullet should be and IS initially hitting, but then as you can see the dust effect is placed a fair bit up the track...

alt text

All bullets are set to continuous dynamic with a capsule collider slightly bigger and longer than the mesh itself. Fixed timestep is set to 0.01.

Is there a way to detect more accurate terrain collider collisions? Or is there an entirely better way to go about it?

Any suggestions or insight would be very welcome :)

untitled-2.jpg (67.6 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Benproductions1 · Oct 16, 2013 at 10:53 PM

Hello,

The reason for your "inaccurate" terrain collision is due to the many optimisations what are done with the terrain collision system.
When it comes to projectile physics, it's either you wirte your own (which you don't want to do), or you deal with the many inaccuracies of rigidbody physics. There is no midpoint unless you want a really high framerate impact from just physics.

Hope this helps, Benproductions1

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

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

Terrain collider failing in unity 5/17? 1 Answer

Player's Rigidbody slides up terrain walls 1 Answer

Bullet projectiles with collision info without affecting others 0 Answers

Object Flies into Air Upon Collision, or goes through hill depending on isKinematic settings 1 Answer

Jump Boost 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