Rope created at runtime is longer than the distance between the two connection points - 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: Rope created at runtime is longer than the distance between the two connection points (/thread-3393.html) |
Rope created at runtime is longer than the distance between the two connection points - NailEngine - 05-04-2022 Code: const string STAND_PARTICLE_GROUP = "PointOnStand"; I'm basically trying to create a chain between these two objects at runtime. The length of the chain should be the distance between those two red X's which mark "mount points" to create the chain between. The circle object isn't "hanging" down because I currently have the rigidbody set to kinematic. Any ideas? RE: Rope created at runtime is longer than the distance between the two connection points - josemendez - 06-04-2022 Hi! There's several possible causes for this (distance constraints stretching scale > 1, poor convergence due to iterations/substeps, among others). Going to assume everything else not shown in your code is set to default settings: You know the distance between the two control points in a straight line, but what's the distance between them along the path? You're normalizing the path tangents, which means that for any distance that's roughly < 1 (the tangent length) the path will be a "flat curve" -move forward, then backwards, then forwards again- and as a result the rope will be longer than the distance between the points in a straight line. Have you tried shortening the tangents? RE: Rope created at runtime is longer than the distance between the two connection points - NailEngine - 06-04-2022 (06-04-2022, 07:49 AM)josemendez Wrote: Hi! Hey, doing what you said worked. I am having a different issue now though, which is:
I have fixed some of the issues with plate sticking; using 0.45 seems to be the highest relaxation that doesn't cause overly elastic movement. There is still more elasticity than I'd like for a chain. As well I configured the rotation compliance of the pin that's on the plate and set that value to one I found in Obi's source of "10000" to mean free-rotate. This creates a reasonably convincing look. Any advice on reducing the elasticity would still be helpful though. The initial sagging though I still need to fix somehow. RE: Rope created at runtime is longer than the distance between the two connection points - NailEngine - 06-04-2022 Well, I feel pretty dumb :| I had some big colliders that were big enough I didn't see them when zoomed in. So effectively they've been doing their physics inside of one of the colliders that the objects are mounted to via pins. Anyway, it's fixed! Thank you for your help RE: Rope created at runtime is longer than the distance between the two connection points - josemendez - 07-04-2022 (06-04-2022, 11:27 PM)NailEngine Wrote: Anyway, it's fixed! Thank you for your help No worries! If excessive elasticity is still an issue, remember that: - More iterations/substeps (specially substeps) will improve simulation quality and reduce spurious stretchiness. See: http://obi.virtualmethodstudio.com/manual/6.3/convergence.html - In all physics engines, large mass ratios (eg, very heavy object hanging from a comparatively light rope) will increase stretchiness. Make sure objects have comparable masses. Within a 1:10 relationship is a good start. kind regards, |