(31-01-2023, 03:19 PM)josemendez Wrote: Yes, you have rope.CalculateLength() that returns the current length of the rope (including any stretch/compression and attachments) and rope.restLength, that returns the length of the rope at rest.
kind regards,
void Update()
{
if (isGrabbed)
cursor.ChangeLength(rope.CalculateLength());
}
change Length like this- is this right?- because when i grab it becomes too long as it was heavily compressed (with 0 compress in distance). Another problem is gravity- should i stretch only if Calculate is much more than starting, or what? Whats the meaning of restLenght?- I thought that it was starting lenght, but it changes in runtime...
(31-01-2023, 03:19 PM)josemendez Wrote: Yes, you have rope.CalculateLength() that returns the current length of the rope (including any stretch/compression and attachments) and rope.restLength, that returns the length of the rope at rest.void Update()
kind regards,
{
if (isGrabbed)
{
curLenght = rope.CalculateLength();
if (curLenght - prevCalculated > delta)
{
prevCalculated = curLenght;
cursor.ChangeLength(prevCalculated);
}
}
}
Adjusted to change only on armstretch, but now have a problem, that if our arms becomes closer the lenght don't shorten- I'd use armsTransforms instead of ropeCalculate, but in that case will be problem with stretching around object- armsPositions.magnitude can be small- any suggestions?
(31-01-2023, 04:20 PM)alex798 Wrote: void Update()
{
if (isGrabbed)
cursor.ChangeLength(rope.CalculateLength());
}
change Length like this- is this right?- because when i grab it becomes too long as it was heavily compressed (with 0 compress in distance). Another problem is gravity- should i stretch only if Calculate is much more than starting, or what? Whats the meaning of restLenght?- I thought that it was starting lenght, but it changes in runtime...
void Update()
{
if (isGrabbed)
{
curLenght = rope.CalculateLength();
if (curLenght - prevCalculated > delta)
{
prevCalculated = curLenght;
cursor.ChangeLength(prevCalculated);
}
}
}
Adjusted to change only on armstretch, but now have a problem, that if our arms becomes closer the lenght don't shorten- I'd use armsTransforms instead of ropeCalculate, but in that case will be problem with stretching around object- armsPositions.magnitude can be small- any suggestions?
Is There any parameter as distance between particles- ideally normalized- then if distance is big- add particles to said limit, and visaVersa?