- Home /
Update collisions
Hi Guys, I was just wondering, does it greatly matter the certain things happen in my Update routine would affect what happens in my OnCollisionEnter routine. You see i have a boolean that checks whether an object is moving or not and thats in the Update(), and in my OnCollisionEnter routine it checks this before performing actions. Are these two intangeable really because something isnt working!
Answer by Berenger · Jun 30, 2012 at 04:18 PM
Update isn't related to the physic loop but to the application's frame rate. It can be called more often, or less. You should do your check in FixedUpdate, or in OnCollisionEnter. You're checking it like that isMoving = rigidbody.velocity.sqrMagnitude > 0.0; right ?
Pretty much yeah, I am using that code, but to check that something is not moving. I am concerned that it is still moving slightly in the update when it is colliding with my object!
this could help you understad and fix your issue. http://docs.unity3d.com/Documentation/$$anonymous$$anual/ExecutionOrder.html
Your answer
Follow this Question
Related Questions
OnCollisionEnter2D Questions 2 Answers
Making a level up button., 2 Answers
Since I can't add a yield during an update, how would I go around it? 1 Answer
Boolean being constantly redefined? 2 Answers