I have a third person character in a VR project similar to Moss which started life as the third person c++ starter project.
I have him moving around and jumping as well as swinging a sword etc. but now I’m working on climbing up a cliff.
I have the ability to jump up and grab a ledge and then climb up as well as move left and right while hanging onto the ledge, but I’m having some problems with the ledge movement.
For ledge detection I have some collision object set on the ledge and a small spherical collider on my main character just in front of his face. When this collider touches a ledge collider he grabs hold of the ledge. At this point I set the movement mode to EMovementMode::MOVE_Flying and snap him to the closest point on the ledge collider.
Now I can move him left and right until he gets to the edge of the collider. I do this by looking at the colliders width and calculate how far he has moved. Each collider has a variable which stores the collider on the right and left so I can connect a string of colliders together and make curved ledges.
This all works except that when I attach to a ledge, I snap to the closest point and this makes the movement around a curved cliff look jerky as he doesn’t rotate around the curve smoothly but instead pops into a new rotation as he passes between the colliders.
To get around this I thought I would remove the snapping rotation and slowly rotate him to match the same rotation as the ledge collider, however I can’t get him to move down the ledge without snapping his rotation because I’m using;
AddMovementInput(GetActorRightVector(), Value);
The docs say AddMovementInput uses a world space vector, but if I pass in the ledge colliders RightVector he doesn’t follow it. I then tried just forcing a vector of (0 1 0) thinking it would move him in world space down the Y axis, but instead he moved locally right and left?
Can anyone tell me how to move a character in a world space vector ignoring his rotation?
I also uploaded a example video showing the movement problem as well as the colliders I have before the game starts.