- Home /
Is there a way to make a wallrunning system using the character controller?
I use character controller for my movement in my game, and I want to make a wall running system. However, all the tutorials I've seen all use a rigidbody. Any way I can do this without changing my movement to rigidbody movement?
I've found, simply rotating the Player, causes it to apply gravity in the direction its feet are pointing to. So, if you rotate your player to face the wall, not 90 degrees but at an incline, it should be able to stick to the wall whilst running.
You'll have to find a way to rotate the player properly, so it returns back to normal when not near a wall.
Answer by MUG806 · Feb 15, 2021 at 08:38 PM
Depends how you are moving the character controller, but one route you could go down is using collision flags to check if the character is touching the walls, but not the floor:
if (controller.collisionFlags == CollisionFlags.Sides) {
print("Only touching sides, nothing else!");
}
You could check for that and allow the player to move as if they are grounded if touching the wall.
You could also try raycasting/capsulecasting to check if there is a wall to either side, and then set up some more specific movement based on where the wall is.
Your answer
Follow this Question
Related Questions
FPS Character Controller with the push DOWN rigidbodies ability 0 Answers
Why do CharacterController objects not come in different collision shapes? 0 Answers
Best Strategy to interact with rigidbody 2 Answers
How can I make my FPS player move towards the direction it is facing 1 Answer
How does the premade FPSController handle character physics? 1 Answer