Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  How to handle multiple attachments (rope-rope, rope-rigidbody)?
#1
Hi, I have a need to handle tree like rope structure with multiple rigidbody attachments and I am confused how to. The setup looks something like this:



   

or like this:

   

multiple ropes connect to other ropes and rigidbodies. Obviously I have a mess with collisions. I tried to solve collision problems with categories, but I am confused a bit. Seems like I can't set different categories per group? Changing 1 group category, changes for the whole rope. So seems that I can't ignore collisions between attached groups, but collide with the rest of the rope? Seems that rigidbodies kind of work if I set the rigid body to collide with everything, and the rope group to ignore the rigid body (collision mask does work per particle group), but this trick does not work for rope to rope. Is there a way to solve this?
Reply
#2
(09-09-2024, 06:26 AM)uatihb Wrote: I tried to solve collision problems with categories, but I am confused a bit.

Hi!

You don't set categories per particle group, but per control point. These are completely different things: A particle group in a rope is a single particle, the one that's right at the location of a control point - when you attach a group, it only attaches one particle. A control point however controls the properties of multiple particles, those that are closest to it. For instance when you change the thickness or the color of a control point it affects multiple particles, same when you change its collision category.

(09-09-2024, 06:26 AM)uatihb Wrote: Seems like I can't set different categories per group?

You can't have multiple categories per group: that wouldn't make sense since filters already can accept/reject collisions with multiple groups.

This works just like Unity's collision layers: you can't have objects be in multiple layers simultaneously, but there's no need to since each layer can ignore any combination of multiple layers.

(09-09-2024, 06:26 AM)uatihb Wrote: Changing 1 group category, changes for the whole rope.

No, it changes for particles along the rope closest to that control point.

(09-09-2024, 06:26 AM)uatihb Wrote: So seems that I can't ignore collisions between attached groups, but collide with the rest of the rope?

You can: just use different categories and set the filters so that they all collide with everything except the categories you don't want to interfere with each other. For instance if you have a rope with 3 control points (left end, middle, right end) and you want the ends to not collide with the objects they're attached to but collide with other particles in the rope, this is one possible setup:

- left end: category 0, collide with 1.
- middle: category 1, collide with 0.
- right end: category 0, collide with 1.
- colliders attached to the ends: category 2, collide with everything except 0.

(09-09-2024, 06:26 AM)uatihb Wrote: Seems that rigidbodies kind of work if I set the rigid body to collide with everything, and the rope group to ignore the rigid body (collision mask does work per particle group), but this trick does not work for rope to rope.

Why wouldn't it work for rope to rope? Collision filters use the same logic for all kinds of collisions. Could you be more specific?

kind regards,
Reply
#3
(09-09-2024, 08:59 AM)josemendez Wrote: You don't set categories per particle group, but per control point. These are completely different things: A particle group in a rope is a single particle, the one that's right at the location of a control point - when you attach a group, it only attaches one particle. A control point however controls the properties of multiple particles, those that are closest to it. For instance when you change the thickness or the color of a control point it affects multiple particles, same when you change its collision category.



Oh, I get it now. I was using control point and particle group interchangeably as I saw "particle group" in the particle attachment.




(09-09-2024, 08:59 AM)josemendez Wrote: You can't have multiple categories per group: that wouldn't make sense since filters already can accept/reject collisions with multiple groups.



I meant per rope to give each control point it's own group. And I managed to make it work after I read your reply that it should work. Probably my problem is Linux/Unity UI related. When I switch between ropes with edit path enabled control points editor behaves weird. Updating 1 control point would update the whole rope, or nothing at all. Now being more careful it works! Thanks.




(09-09-2024, 08:59 AM)josemendez Wrote: You can: just use different categories and set the filters so that they all collide with everything except the categories you don't want to interfere with each other. For instance if you have a rope with 3 control points (left end, middle, right end) and you want the ends to not collide with the objects they're attached to but collide with other particles in the rope, this is one possible setup:

- left end: category 0, collide with 1.
- middle: category 1, collide with 0.
- right end: category 0, collide with 1.
- colliders attached to the ends: category 2, collide with everything except 0.

Why wouldn't it work for rope to rope? Collision filters use the same logic for all kinds of collisions. Could you be more specific?



All my wonky setup. It works. Sorry for the redundant questions, but the confirmation that it should work made me look for the problem on my side which helped to solve the issue. Would be a good help to have a more difficult setups like mine in examples! Sonrisa




(09-09-2024, 08:59 AM)josemendez Wrote: No, it changes for particles along the rope closest to that control point.



Can this be controlled precisely? Like how many particles I want to be in that control point belonging to that particular collision layer?
Reply
#4
(10-09-2024, 12:40 PM)uatihb Wrote: Can this be controlled precisely? Like how many particles I want to be in that control point belonging to that particular collision layer?

No, because this is determined by curve interpolation. However you can add more control points for this purpose, by default when adding a control point it gets all its properties by interpolating the surrounding curve so that the path is not altered.

So for finer control you can just create a new control point and change its collision layer. All other properties (position, color, thickness, etc) will leave the path intact.

kind regards,
Reply