Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Stick" rigidbodies to softbody
#7
A coding tip:

Code:
if (!glittersList.Contains(glitterInstance))
     glittersList.Add(glitterInstance);

That will kill performance once you have a few dozen glitter objects. Every time an object contacts a particle, you're iterating over the entire list of all attached glitters to see if it's already there.

This "if (!glittersList.Contains(glitterInstance)" condition is not needed, as you're already checking whether the glitter instance is attached or not (if(!glitterInstance.isAttached)). You can't attach a glitter twice, so no need to check if it's already in the list.
Reply


Messages In This Thread
"Stick" rigidbodies to softbody - by Spectra_7 - 07-05-2021, 10:08 AM
RE: "Stick" rigidbodies to softbody - by josemendez - 07-05-2021, 01:52 PM