- Home /
How to implement a first person slide?
How might the algorithm go for a "powerslide" on a first person controller? Something like Titanfall 2 where:
Crouching while sprinting will keep them moving in the direction they were moving until they slow down to a certain speed
You cannot move during a slide
You can jump out of a slide or crouch out of it, returning to a standing position
When the slide is finished, you enter a crouching position.
Right now I'm figuring it'll be a coroutine that gets passed the direction they're moving and boosts them a little before checking if they're at that certain speed, ending it if they hit it.
I don't have much experience with coroutines though, so does this sound implementable?
Particular questions:
How do I check the player's speed at any given moment? (for comparison with target speed)
How do I even have the player move in the direction once it's passed in?
How is friction calculated?
How would this fit in a coroutine?
I'm using the Standard First Person Controller for reference, so making it fit into there might be a pain.
Your answer
