Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Rest Length" returns unexpected values
#5
(20-05-2021, 05:50 PM)josemendez Wrote: You're measuring the blueprint's rest length. The default rope prefab has 100 pooled particles. That's a blueprint rest length of roughly 2/5*100 = 40 meters, so the reported value is correct.

If you want to get the runtime rest length, use rope.restLength. That will give you the rest length of the currently active particles.


Attachment size is capped to keep hosting costs reasonable. You can upload them to imgur or some other website and paste the link here.

I'm trying to instantiate a rope that follows the given curve, but then the tightness of the rope can be adjusted by setting its overall rest length to the distance between the two connected points, scaled by some factor. This needs to be done in the blueprint if my understanding is correct.

Originally I tried just scaling the rest distances inside the blueprint by some factor during the Generate() steps, but if the rope curved, it'd be longer than the distance between the two points and not taut.

I thought then, I could make the rope not curve, by setting the tangents somewhere colinear with the start and end points. But the tangents of the path endpoints are set to the normals of the surfaces they are attached to. This way, when the rope is loose, it'd try to keep the rope's ends parallel with their attach points' surface normals.

So, I went with calculating the ratio between the current length measured in the blueprint and the desired length (euclidean distance between the two attach points) deand scaling the rest distances by that ratio. (restLength *= desiredOverallRestLength / currentOverallRestLength). But then noticed the rope was getting very small.

Is there some way to know what the actual rest length of the rope will be in the blueprint generation phase?
Reply


Messages In This Thread
RE: "Rest Length" returns unexpected values - by Hatchling - 20-05-2021, 06:09 PM