Moving player along line

I am making a “Grapple Hook” type effect, and am looking for a way to move the player along the Line Renderer. The line starts at the transform of the player, and ends at the coords of the mouse click.

The player uses a Character Controller to move, and I have tried doing a moveDirection type movement, but I cannot get it right.

I am not looking for a “swing” effect, I just want the player to be pulled to that point.

Thanks for any suggestions!

(this is how my movement is played out)

moveDirection = Vector3(Input.GetAxis("Horizontal"), 0, 0);
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= speed;

You can do a waypoint system, if im right your linerenderer should have a list of vector3’s with it, and you can take those and convert them to an array of vector3’s then just use those as waypoints for your character to move on.

Is “just” a matter of finding the correct direction to move in?

If so the vector from your player capsule to the “Yes” point will be the vector from you player to the origin plus the vector form the origin to the point.

moveDirection = yesPoint.transform.position - player.transform.position;

If you want to involve the “horizontal” input axis, use it as a scalar value to multiply the moveDirection just like the speed and time.deltatime.

moveDirection = moveDirection * Input.getAxis("Horizontal") * speed;