03-11-2020, 09:42 AM
(01-11-2020, 10:12 PM)VagabondOfHell Wrote: Hi Obi
I'm curious if there is a reliable way of calculating the Maximum Rest Length based off of the pooled particle count. During my testing I've beenĀ setting my cursor length to Mathf.Infinity in the OnElementsGenerated callback of the instantiated ropeĀ and then resetting it to it's previous length to determine this. Just curious if there's a better way to go about it.
Thank you, and fantastic job on the Obi Rope asset!
Hi there!
Pooled particles are spaced apart using
Code:
rope.ropeBlueprint.interParticleDistance
So you can take the rope's rest length, and add rope.ropeBlueprint.interParticleDistance * rope.ropeBlueprint.pooledParticles to it. That should be a pretty reliable estimation of the rest length once all pooled particles are used.
cheers!