Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ropearound like physics
#3
(03-06-2020, 04:48 PM)josemendez Wrote: Hi there,

This is easy to achieve. Simply use a rope with enough resolution, and crank up distance and collision iterations quite high. That's pretty much it. Having a ObiParticleRenderer component on the rope is useful to visualize and debug particles. Let me know if you have issues with this.

Hi, I'm glad to hear that could be done using Obi Rope Sonrisa  Thank you for your reply.

I did the settings that you suggest. If I'm not increase the lenght of the rope the particles are seperated from each other. Is there any automatic way to tell the renderer if particles are seperated more than a value, add new particles to the rope, or am I need to figure it out by myself?

Edit: After struggle a little more, I figured it out I can get the total lenght of the rope by using CalculateLength method. But I can't figured it out how to properly add or remove particles using this value.

So far, I did it like this but it is not consistent especially when going back. 

Code:
private void Update()
   {
       _totalMovementDistance = _obiRope.CalculateLength();

       if (_totalMovementDistance > _lastTotalMovementDistance)
       {
           _obiRopeCursor.ChangeLength(_obiRope.RestLength + 1f * Time.deltaTime);

           _lastTotalMovementDistance = _totalMovementDistance;
       }
       else if (_totalMovementDistance < _lastTotalMovementDistance && _totalMovementDistance >= _initialLength)
       {
_obiRopeCursor.ChangeLength(_obiRope.RestLength - 1f * Time.deltaTime);

           _lastTotalMovementDistance = _totalMovementDistance;
       }
   }
Reply


Messages In This Thread
Ropearound like physics - by relevantname - 03-06-2020, 04:43 PM
RE: Ropearound like physics - by josemendez - 03-06-2020, 04:48 PM
RE: Ropearound like physics - by relevantname - 03-06-2020, 08:18 PM
RE: Ropearound like physics - by josemendez - 04-06-2020, 08:06 AM
RE: Ropearound like physics - by relevantname - 04-06-2020, 08:46 AM
RE: Ropearound like physics - by josemendez - 04-06-2020, 09:24 AM
RE: Ropearound like physics - by relevantname - 04-06-2020, 09:57 AM
RE: Ropearound like physics - by josemendez - 04-06-2020, 10:13 AM
RE: Ropearound like physics - by relevantname - 04-06-2020, 10:49 AM