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?
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.
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
3 People are following this question.
Unity 2d, Need help with Player Sliding when Swiping Down
Make Character swim
Transform.LookAt snaps back to it's last location
First person camera judder with rigidbody based characters
Movement issues with keyboard