Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Pinning rope particles on collision
#1
Hi there,

I'm currently working with the ropes and want to have it completly stick on collision. I already have code to detect collision and create the Pin constraint but I'm still having several issues with it.

Setting the stickiness value of the collision material to one just makes the rope go crazy around the mesh so I'm using the pin constraints. When all particles of the ropes collided with the collider I want all of them to stay in place and don't even need any physics calculation for it. But I haven't found on how do achieve that yet. I've also noticed that even though there is a pin constraint the rope doesn't really stick and slips off the collider just falling to the ground or there is some particles that are supposed to stick but still fly around.

What I do right now in the code is that I use the OnCollision callback and add a Pin constraint (like in the documentation). The problem is if I have multiple ropes the performance drops quickly so I try to check if all particles already have a pin constraint and then just skip the whole collision detection.

But from what I see is that I have to iterate over all contact points which grows a lot with the mesh collider and the amount ropes with the particles (each rope has about 8 particles). For me it feels like I iterate over every contact even those that are not part of the rope.

If you need more information please let me know.
Reply


Messages In This Thread
Pinning rope particles on collision - by Spartan190 - 28-09-2022, 07:47 PM