Hi, I am currently making a rope/grapple swinging system.
I am using a hingejoint as the point the character swings from the current problem I am having is that I can't find away to make the character move up the rope.
I have tried using a vector movetowatds but that didn't work.
Right now I am using this code:
if (Input.GetKey(KeyCode.S))
{
addY += 0.1f;
addZ += 0.1f;
}
if (Input.GetKey(KeyCode.W))
{
addY -= 0.1f;
addZ -= 0.1f;
}
float curX = gX + addX;
float curY = gY + addY;
float curZ = gZ + addZ;
grapplePoint.connectedAnchor = new Vector3(curX, curY, curZ);
But that results in this![alt text][1]
When the connectedAnchor Y float goes from over 0 to under 0 the player starts going in the opposite direction.
Does anyone know a way I can make the player "Climb" the rope?
[1]: /storage/temp/127715-ezgifcom-optimize.gif
↧