Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 ROMgame · Sep 20, 2015 at 07:22 PM · collisionphysicsrigidbodyphysics2dexecution order

Unity Physics Collision Execution Order Error?

So in my game I have two wall objects, "Left Wall" and "Right Wall". They are separated by a large empty room.

I then have an object attached to the right wall, when I tap the mouse button the idea is that a large force will be applied to the object on the right wall to fling it onto the left wall in a single frame. The problem is - the following happens:

  1. The mouse button is pressed and the object that is attached to the right wall has its velocity modified during the next frames "FixedUpdate()" - increasing it to a very, very high value.

  2. Following the "FixedUpdate()", "OnCollisionEnter()" is automatically called - telling the object that it has entered the left wall - as expected.

  3. "Update()" is automatically called on all objects.

  4. "OnCollisionExit()" is automatically called - telling the object that it has exited the right wall

So that's pretty weird - the object should be told it has exited the right wall at the same time it's told that it has entered the left wall (before Update) - right? They definitely are not overlapping - i've separated them by huge amounts of space to be sure. So why isn't OnCollisionExit being called right after FixedUpdate? Very puzzling!

Note : My actual use case is not the above - the above is just a simplified version I've been testing to help me to debug why OnCollisionExit isn't getting called straight after FixedUpdate!

Any help would be much appreciated - I'm at a bit of a loss for how to solve this one!

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 Vivek-Joshi · Sep 22, 2015 at 06:28 AM 0
Share

Try reducing it's velocity, if it helps.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by dudester · Sep 22, 2015 at 01:43 PM

perhaps your frame rate is to high or your timestep is to low , if its the first try enable vsync as Update is called each frame reduces the framerate to 60 and try increase your Timestep also make sure to mark your rigidbody as continuous dynamic so as to ensure its doing the collision right,also unless your wall is very thin its gonna take a lil time for the wall to exit the collider so maybe one frame?

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Recalculating collisions after Physics2D.IgnoreLayerCollision()? 1 Answer

Is it possible to disable collisions for separate physics scene? 0 Answers

Handling colliders on hundreds of asteroids (not procedural asteroids) ...URGENT 3 Answers

physics culling mask? 1 Answer

Keep Horizontal Momentum after Jump 2 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