- Home /
Will a component destroyed after the FixedUpdate loop or the Update loop if Destroy(component) is called in FixedUpdate
The documentation of the Destroy method says: " Actual object destruction is always delayed until after the current Update loop, but will always be done before rendering". But after Destroying joints in FixedUpdate I believe that the joints are destroyed before the next physics engines calculations, after the FixedUpdate loop.
I usually also "disable" the object being destroyed. For a creature, set dead to true. For a joint, I'd unhook it.
I'm sure the ti$$anonymous$$g of Destroy has some well-defined behavior, which maybe I should know. But there are enough weird cases (maybe yours is one) that it seems safer to have $$anonymous$$imal expectations for when it will happen.
Your answer
Follow this Question
Related Questions
How to "hide" C# code from custom package for distribution? 1 Answer
Question! Why does the 'WheelCollider' Component act funny? 1 Answer
IL2CPP with JIT-requiring code: When does it report this? 1 Answer
Unity DOTS - How is it that they've implemented Entities.ForEach? 0 Answers
How do switch() statements work? 0 Answers