(10 hours ago)josemendez Wrote: Hi!public class RopeLengthController : MonoBehaviour
Unless you explicitly write a script that does this, the rope won't automatically increase its length to follow the hook or stop doing so on a specific condition. The way you change the length of a rope at runtime is by using a cursor and calling its ChangeLength() method in your scripts, passing how much length you want it to increase/decrease.
You can see examples of cursors being used to increase the length of a rope in various of the included sample scenes (Crane, FreightLift, GrapplingHook, to name a few).
Compliance (aka flexibility) is the inverse of stiffness, so yes very small values are to be used. Rubber for instance has a compliance of 1x10^-6 m/N (that is, 0.000001). You can look up material compliance tables online.
A compliance of 0 means "as stiff as possible, given current simulation budget" which is the default. You can increase the simulation budget by spending more substeps on the solver. Using more substeps (or decreasing rope resolution) will yield a stiffer rope.
The manual contains a very in-depth explanation of how the engine works internally and how substeps/iterations affect simulation quality.
So you do have a script that changes the length of the rope? Could you share your code so that I can take a look?
kind regards,
{
public bool StartThrow;
public ObiRope rope; // Das Obi Rope-Objekt
public ObiRopeCursor cursor; // Der Obi Rope Cursor, um die Länge zu ändern
public Rigidbody bait; // Der Köder (bereits mit der Schnur verbunden)
public Transform rodTip; // Spitze der Angelrute
public float maxLineLength = 50f; // Maximale Länge der Angelschnur
public float minLineLength = 1f; // Minimale Länge der Angelschnur
public float speedMultiplier = 0.1f; // Multiplikator für die Verlängerung basierend auf Geschwindigkeit
public float tensionThreshold = 1f; // Schwelle, ab der Spannung die Schnur verlängert
private float currentLength; // Aktuelle Länge der Schnur
void Start()
{
currentLength = rope.restLength; // Setze die aktuelle Länge auf die Ruhelänge
}
void FixedUpdate()
{
if (StartThrow)
{
// Berechne die Distanz zwischen Angelspitze und Köder
float distance = Vector3.Distance(rodTip.position, bait.position);
// Wenn die Distanz größer ist als die aktuelle Seillänge, verlängere die Schnur
if (distance > currentLength)
{
float newLength = Mathf.Min(distance, maxLineLength);
cursor.ChangeLength(newLength - rope.restLength);
currentLength = newLength;
}
}
}
}
(10 hours ago)josemendez Wrote: As a side note, other users have created fishing rod setups in the past. May be relevant to your use case:yes the video on the first link looks pretty good and i want it like that the only difference i want to use Rigidbody.Addforce(impulse) but i dont get it how to do it.
https://obi.virtualmethodstudio.com/foru...-4062.html
http://obi.virtualmethodstudio.com/forum...-4331.html