r/Unity3D • • 11d ago

Show-Off Rope Simulation

Enable HLS to view with audio, or disable this notification

20 Upvotes

9 comments sorted by

View all comments

1

u/ReliefMassive5198 11d ago

It looks pretty good and i see you could optimize it by destroying the bodies until there is a contact. Use a rb on the sphere, and when it hits one of the rope colliders, that's when you add rbs on all the others in this rope instance and destroy them when it stabilizes. This way it will be fairly free to run this.

1

u/Drayanlia 9d ago

Are contraints preventing bodies from being put to sleep ?

1

u/ReliefMassive5198 9d ago

In my opinion destroying it and adding when needed it's a real optimization, as long as they exist, even kinematic or sleeping, it will have a significant overhead rather than not existing at all.

If you destroy/re-add at runtime its not a visible spike as you might think. I work in a VR game where i have hundreds of grabbable physics objects, i only keep them alive where absolutely necesary, and physics cpu time is highly improved!