30-08-2022, 07:21 AM
(29-08-2022, 06:17 PM)shaylavi Wrote: Thank you for your response josemendez!
1. Where should the cursor be located along the rope?
Depends on what you want to do, for grappling hooks / swings it is usually places at the start of the rope, near the character (mu parameter set to 0).
(29-08-2022, 06:17 PM)shaylavi Wrote: 2. I'm setting the length of the rope in the update function until the rigidbody at the end of the rope collides with something.
If you're setting the length in Update(), you're changing the length and simulating the rope out of sync. It's better to do it in FixedUpdate().
(29-08-2022, 06:17 PM)shaylavi Wrote: 3. They are the same mass. I tried increasing the mass of the player but the rope becomes too stretchy (even after all your suggestions for increasing rope stiffness).
Is there a way to cancel the rope velocity at the frame which the rigidbody collides?
You can set the velocity of all particles to zero using the particles API:
http://obi.virtualmethodstudio.com/manua...icles.html
However I'm still not 100% sure where that impulse originates from: If you're setting the length of the rope in Update() to be the distance between the character and the rigidbody, then by the time the rigidbody hits a wall the rope should not be stretched and pull from the character.
The character can only move due to the inertia of the rope, in the included GrapplingHook scene this is avoided by fixing particles in place while the rope is being shot towards the wall: particles have their inverse masses set to zero (this excludes them from the simulation) and their position is manually updated. Have you tried this sample scene? sounds very similar to your use case, and already solves the issue you're describing.
kind regards,