Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Rope around collider
#5
(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.

kind regards,
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?

(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?
Reply


Messages In This Thread
Rope around collider - by alex798 - 30-01-2023, 05:30 PM
RE: Rope around collider - by josemendez - 31-01-2023, 11:47 AM
RE: Rope around collider - by alex798 - 31-01-2023, 02:55 PM
RE: Rope around collider - by josemendez - 31-01-2023, 03:19 PM
RE: Rope around collider - by alex798 - 31-01-2023, 04:20 PM
RE: Rope around collider - by josemendez - 31-01-2023, 09:38 PM
RE: Rope around collider - by alex798 - 01-02-2023, 10:51 AM
RE: Rope around collider - by josemendez - 01-02-2023, 11:13 AM
RE: Rope around collider - by alex798 - 01-02-2023, 11:45 AM
RE: Rope around collider - by josemendez - 01-02-2023, 11:51 AM
RE: Rope around collider - by alex798 - 02-02-2023, 10:38 AM
RE: Rope around collider - by josemendez - 02-02-2023, 11:03 AM
RE: Rope around collider - by alex798 - 02-02-2023, 11:26 AM
RE: Rope around collider - by josemendez - 02-02-2023, 01:42 PM
RE: Rope around collider - by alex798 - 02-02-2023, 02:28 PM