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 ejtech · Jul 19, 2012 at 10:29 AM · collisionbounce

Bouncing when dealing with fast moving objects

I am making a game that involves bouncing a ball off of static objects. Sometimes the ball moves to fast and passes through the other objects ignoring their colliders.

I changed the balls collision detection mode to continuous to try to solve the problem. While this did solve the problem of the ball ignoring the colliders, the collision is still problematic. I have a physics material that allows the ball to bounce off of the other objects. However, which the collision dection mode set to continuous, the bounce off the objects would be delayed or non existent.

Any idea on a work around, that allow fast objects to collide with static objects and smoothly bounce off smoothly?

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

2 Replies

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

Answer by ScroodgeM · Jul 19, 2012 at 06:47 PM

method 1: make a static colliders thick enough so it can't be intersect in one fixed-update cycle

method 2: make a fixed-update cycle lower (edit - project settings - time)

method 3: make a rigidbody kinematic and apply physic manually. ball usually have very easy physic model so it will not be a trouble.

Comment
Add comment · Show 3 · 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 ejtech · Jul 20, 2012 at 02:46 AM 0
Share

I have thought about the first two, but the 3rd method is new to me. Would you $$anonymous$$d describing what it would entail as it seems promising?

avatar image ScroodgeM · Jul 20, 2012 at 04:09 AM 0
Share

i worked in one project where player controls a cannon and fires with cannonballs. cannonballs has a great speed especially at start of way, and it was an issue to calc physic manually cause theese balls often turned out to be below terrain. speed was too high to fix it using first two methods. so i used a third one.

first to control kinematic rigidbodies you must apply speed manually. current speed must be stored in property

http://docs.unity3d.com/Documentation/ScriptReference/Rigidbody.$$anonymous$$ovePosition.html

second, simply add gravity - every fixed update add an offset to speed (speed += new Vector3(0f, -9.8f, 0f) * Time.fixedTimeStamp)

and the last one - just detect a collisions with other objects and get a contact point, then apply reflected speed. also apply a multiplier to speed to imitate bouncing power.

http://docs.unity3d.com/Documentation/ScriptReference/Vector3.Reflect.html

also can be an issue where ball collides just intersected surface - then you just need to move ball by surface normal from 'below' to 'above' surface

should work little better then built-in physic calculating.

avatar image ejtech · Jul 20, 2012 at 04:27 AM 0
Share

Hey thanks for the help. That option didn't really cross my $$anonymous$$d. Essentially, there would be some high school physics involved. I'm not sure if it would be the simplest solution currently after overlooking my setup. On another note, I stumbled across http://www.unifycommunity.com/wiki/index.php?title=DontGoThroughThings which seems to fit better in my situation.

Yet, thanks for another workaround which I'm sure I will use in the future.

avatar image
0

Answer by Paulo-Henrique025 · Jul 20, 2012 at 04:40 AM

Take in mind the scale of your objects, if you are working with a large ball(~15x the normal) you are for sure applying a very strong gravity so it can move very fast, and there is a problem: Large objects aways seems to move slower because you are looking at them from far away, them you apply more and more force to make it faster and break the physics because your "step" is so big that is ignoring colliders.

Make a X:1 Y:1 Z:1 scale ball and apply your physics just to test it.

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

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity2D Collision is bugged 0 Answers

How to make a 2D "trampoline"? 2 Answers

Physics Collision problem(when ball enter to next ground) :( Seeking for solution from more than 1 month 1 Answer

Destroy Projectile on collision 3 Answers

AI enemy bouncing with no collision 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