07-06-2024, 12:20 PM
(This post was last modified: 07-06-2024, 12:22 PM by josemendez.)
(07-06-2024, 12:05 PM)kripa1415 Wrote: Hi,
Yes no gravity kind of behaviour and rope stretch that was the problem. I set hanging object rigidbody y-axis position constraints locked. Rope was also stretching way beyond what I expected.
Now I solved it by releasing shape rigidbody y constraint and setting a base collider for it.
Overall gravity changed from y axis to z-axis to Vector3(0, 0, -9.81)
Set rope blue print mass to .2 while creating control points
Set hanging object mass to 100kg with z and x rotation constraint enabled
Adjusted the below rope params
Code:rope.distanceConstraintsEnabled = true;
rope.stretchingScale = .05f;
rope.stretchCompliance = 0.003f;
rope.bendCompliance = 1;
rope.maxBending = .5f;
Now its working!
https://drive.google.com/file/d/12RuGP6i...sp=sharing
Hi,
Good that it's working, but just wanted to point out that none of the parameters you set make any sense!
(07-06-2024, 12:05 PM)kripa1415 Wrote: Overall gravity changed from y axis to z-axis to Vector3(0, 0, -9.81)
Unity always uses Y as the vertical axis, both in 2D and 3D mode. Unless your game is oriented such that Z is its "down" vector (which will only happen if your camera is up in the air looking directly at the floor) gravity should be in the Y axis.
(07-06-2024, 12:05 PM)kripa1415 Wrote: Set rope blue print mass to .2 while creating control points
Set hanging object mass to 100kg with z and x rotation constraint enabled
Such a huge mass difference will make the rope stretch a lot more, not less. Generally in games you should strive for objects to not have a mass ratio larger than 1:10, yours is 1:500 (100/0.2). Either increase the rope's blueprint mass, or reduce the hanging object mass until either is not more than 10 times the other.
(07-06-2024, 12:05 PM)kripa1415 Wrote: Adjusted the below rope params
stretchingScale = 0.05f: tell the rope to compress to 5% of its initial length.
stretchCompliance = 0.003f: tell the rope to allow up to 30% of stretching.
bendCompliance = 1: tell the rope to not resist bending at all.
rope.maxBending = .5f: doesn't matter what you set, since bendCompliance = 1
These settings will result in a really short rope that stretches a lot, which I doubt is what you want. Typically you'd want the stretchingScale to be 1 and stretchCompliance to be 0 for a rope that doesn't stretch. Also, bendCompliance should be a lot lower unless you want to basically disable bending.
kind regards,