Obi Particle Attachment marking constraint as dirty every frame - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html) +--- Thread: Obi Particle Attachment marking constraint as dirty every frame (/thread-2552.html) |
Obi Particle Attachment marking constraint as dirty every frame - Kristianstoyl - 21-10-2020 When using ObiParticleAttachment as Dynamic constraint, the constraints are set to dirty every frame. This causes the constraints to be re-created every frame which allocates GC every frame. A good example of what I mean is in the "Rocker" sample scene. I see 1 KB GC being allocated every frame. Is there some way to check if the constraint actually changed before it is marked as dirty? RE: Obi Particle Attachment marking constraint as dirty every frame - josemendez - 22-10-2020 (21-10-2020, 04:10 PM)Kristianstoyl Wrote: When using ObiParticleAttachment as Dynamic constraint, the constraints are set to dirty every frame. Hi, Replace the UpdateDynamicAttachment method in ObiParticleAttachment.cs with this: Code: private void UpdateDynamicAttachment(float stepTime) That should get rid of the allocation. Thanks for reporting this! |