How do I create a rope swing using cable component?

Hi, am fairly new with Unreal Engine I know the basic stuff and little but not great.

I have been trying to create a rope swing where the player has to jump on the rope to swing NOT with the swing like Spider-Man as I seen a tutorial on that which cool but not what am trying to make but like Going Up/Down a Rope, rotating on a rope and actual swinging on a rope.

I have created the rope using the cable component with PhysicsConstraint in the blueprint but every time I attached the PhysicsConstraint to the third person character everytime it overlaping the character doesn’t attach to the rope but keep falling off.

how do you make it so that the character stays attach to the rope?


Without actually attempting it myself; my best guess would be looking into sockets.
Here’s a short introduction to how they’re typically used: Skeleton Assets: Using Sockets | 04 | v4.8 Tutorial Series | Unreal Engine - YouTube

What I’m not certain of is how the cable component actually works, so I cannot advise on that front.

One possible approach that comes to mind is a skeletal mesh with a bone chain running along its length, which would be your rope. Then, you could add a socket at each joint, along with some kind of collision detection, and when the character collides, the nearest socket to the character, or a part of the character, such as the hands, could be attached to that socket component.

You will likely want to add physics simulation to both the rope and character, and for swinging, say if the player wishes to influence the swing, then you could use AddImpulse on the players input, to the rope. As the character would technically be a child of the rope (beneath a socket), then the character would also be moved along with the rope.
If you wanted to get really clever, then you could probably align the character’s hands with the sockets when climbing, so it would always look as though it was holding on.

All just my first ideas on the topic. I don’t imagine it will be a simple process to have climbable ropes that are also influenced by physics.

Take a look at this answer I found:

Hi Greyacke.

thanks for your advice, I give it a try also I don’t really want the player to be able to climb the rope only to swing from it

here is the blueprint for the RopeSwing so far with the player keep fall/pushed away from the rope



also forgot the first part of the blueprint

If I get chance, I’ll have a tinker with this myself later on, but before that, could I ask; have you debugged this yet? Perhaps added some print function calls on collision as well as to check that a socket has been found?

You also don’t want that cast to your character following the collision, I don’t think. I suspect that you actually want to make a comparison between the reference (CharRef) and the other actor.

Persevere with it! With any luck, you’ll have found a solution before I or someone else gets round to it :stuck_out_tongue_winking_eye:

yea I have debugged it using print string so I know it connecting but just not staying on.

if I take out the cast to third person character on the collision replace it with my char node then nothing happens it won’t even go to PhysicsConstraint point.


yea am going to keep trying until it done :smiley: