How to implement rope mechanic that respect meshes in level

Hello,

I’m working on a game where player can shoot rope to connect two things in level (firing once connects one end of rope and firing second time connects second end of rope). That can be AI to exploding barrels (rope tension will make barrel fly towards AI and explode on contact) or AI to a rotating drill (AI gets pulled into the drill and gets smashed) and other fun mechanics revolving around rope. But I want the rope to respect meshes in level. For example if player shoot rope on a static wall and starts walking it has to wrap around objects in middle. Rope’s length can be infinite so player can walk around as much as he want and rope will not restrict him.

Unreal’s rope just goes through any mesh that is in between. I started trying to do this through and the result is as shown.

Also problem with using spline is they don’t respect gravity. How can I create rope that I want? What is the direction that I should be looking at?

Hello,

Are you using a cable component? If so there is no way to make it interact physically with the environement.

I made a chain using a simple rig imported from 3ds max, set the first bone to Kinematic so I can animate it, and the rest of them to Simulated so they have physics. You need to check Simulate physic in the properties of the skeletal mesh, and you need to have a physic asset if I’m not mistaken for it to collide with the world.

I would be interested to know though how you managed to make your rope follow by grabbing another item, that is precisely what I’ve been failing to do all day!

Thanks

Hi,

We pivoted to making the rope straight and used cable component.
To pull, if the object rope is connected to has physics enabled then we apply force based on the mass of the object in the direction of cable at the point of contact.

EDIT: FYI post for future visitors - didn’t realise age of question.

The cable component does have an “Enable Collision” option, but it’s not perfect.

As you’re moving the rope manually, it will likely get stuck and tangled on objects, rather than being stopped by them.

It was enough of a solution in my case to continuously check the distance between each point on the cable component, and if the distance was extreme, the rope was likely caught on something and being stretched, it would then detach and ragdoll - an action similar to being “snagged”.

Nice, I used constraint in the BP to link a cable component to some bucket, my issue was with pulling the bucket up by tightening the constraint but it didn’t work like that, had to cheat :slight_smile:

Good luck and thanks!