How to match player speed variable to character controller move?

I’m using character controller for the player movement, and a speed variable is used to control how fast the player moves, accelerates and decelerates. This is then passed into the vector3 that drives the character controller Move() function. The problem is, when the character controller is against a wall and stops, the speed variable still thinks the player is moving. I’m not sure how to correct this, what’s the usual method of working with character controller in this way?

Just check in Move() with a raycast if the player can move forward otherwise do another animation?

Thanks, but I don’t mean the animation, I mean the variable that sets the speed that controls the vector3 that drives the Move() function.

Well then instead of the animation change the speed to 0 when a raycast hits under a certain distance? I don’t use the character controller but that’s pretty much how all of them check for walls… Maybe I’m misunderstanding, you don’t know how to change the speed variable?

Yeah, I was just hoping there was a way of feeding the character controller’s internal velocity back to mine so it knows if it’s hit a wall by itself, either that or maybe setting character controller’s velocity manually?