I am trying to get a character model to climb a rope. The current system i have is almost functioning correctly, but if you climb up and down the rope a few times without dismounting, the character eventually goes out of alignment with the rope, and the hand movement in the animation slowly angles away from the rope until the character is grabbing air.
What i have done is set up a static mesh rope, pivot point at the top. Attached this via a physics constraint component to a static mesh anchor placed just above the rope. The character is animated to move in and jump onto the rope, and this is achieved with a in-place animation in combination with some blueprints to rotate the character towards the rope, then use a lerp/timeline to move the character into place. This aligns the outstretched left had exactly onto the rope. then the characters mesh is attached to the rope static mesh, and force is applied to the rope to make it swing.
This part all seems to be working perfectly, and looks quite good. Once the force is applied, the rope moves around with the mass of the character, and i use a “set world location” node along with a “get up vector” node to move the mesh in the z direction relative to the angle of the mesh, and then i manually move the player controller along with it to keep the camera in place (third person camera).
Theoretically, when the mesh is moved in it’s relative z direction (determined by the mesh being attached to the rope), it should move up the rope in a perfectly straight line at whatever angle the rope is on. But it’s not quite working out that way. It works well for one or two climbs as i said, but as i move up and down it slowly goes out of alignment.
So does anybody have any ideas how i might go about perfecting this? Or am i going about it in totally the wrong way? I have tried to reorient the mesh every update frame to keep it in position, but this has proved difficult to do with the pivot point located at the top of the rope and the rope being on a variable angle.