Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Obi Rope attachment
#6
(30-06-2023, 07:05 AM)josemendez Wrote: Hi,

In the video it looks like the attachments are being added dynamically when the cube is close to or in contact with the rope. May you share the code you're using to do this?

kind regards,

I'm experiencing the same problem (at least I think so), for what it's worth.

When I create a dynamic attachment at runtime on the last particle of a short rope, the same behavior is observed.

Here's my code that moves the particle using the actor's elements and enables the attachment:

lineEndAttachment.enabled = false;
var fish = _fish[_currFishIndex];

var localPosition = fishingLine.solver.transform.InverseTransformPoint(fish.transform.position);
int lastParticleIndex = fishingLine.elements[^1].particle2;

fishingLine.solver.positions[lastParticleIndex] = localPosition;


lineEndAttachment.target = fish.transform;
lineEndAttachment.enabled = true;


Edit: it actually happens any time after the cursor has shortened the rope. It seems my method for getting the last particle stops working after that.
Reply


Messages In This Thread
Obi Rope attachment - by parzi - 29-06-2023, 08:44 AM
RE: Obi Rope attachment - by parzi - 29-06-2023, 01:36 PM
RE: Obi Rope attachment - by josemendez - 30-06-2023, 07:05 AM
RE: Obi Rope attachment - by parzi - 30-06-2023, 07:57 AM
RE: Obi Rope attachment - by astro.domine - 05-09-2023, 01:40 AM
RE: Obi Rope attachment - by parzi - 30-06-2023, 12:37 PM
RE: Obi Rope attachment - by astro.domine - 05-09-2023, 03:11 AM