Struggling to make a decision on the implementation of a ledge climb mechanic for a physics driven 2d platformer. What is the best way to go about this without it getting overly complex?
So far I understand (hobbyist here not a pro) there a few options including:
Apply controlled force to the rigid body on the y axis until the root position is just above the hand position then apply enough force on the x axis so as the character is standing on the platform. At the same time somehow sync this with the climb animation(s).
Remarks: movement is easy here and can even be controlled by a prismatic sliding joint but I'm unsure of how I would keep the animations (spine) in sync with the movement.
Root motion animation that drives the root position of the character. Teleport the rigid body when complete and hope box2d can still properly respond in time to any collision if any objects happen to fall from the sky.
Remarks: sounds easier to actually animate but not sure if I'll run into any problems with the spine runtime, box2d or later down the line moving platforms and varied height platforms.
Apply IK constraint programmatically on the hands to lock them in place and proceed to rotate the bones manually or apply small preset (few keys/frames) animations whilst applying the needed force to the rigid body at the same time.
Remarks: seems like this would give maximum control to the player but it sounds way to complicated for me to implement at my level, not exactly sure where I would start.
Thanks in advance for any input!
FYI: This is an ECS (libgdx + ashley) based engine with box2d. The ledge grab is already implemented as a separate system so we can assume here that the character is already capable of hanging from a ledge of any height.