- Home /
Change velocity of Character Controller
I am using a character controller as my main character in my game and I would like to be able to randomly change his velocity based on how much he falls. I can detect his velocity be calling charactercontroller.velocity, but when I try to set this equal to a variable, unity tells me that charactercontroller.velocity is read only. Can I only get this function if I use a rigidbody as my character? Thanks.
Answer by AngryOldMan · Apr 25, 2011 at 06:17 PM
you need to alter the variable which controls your movement or gravity speed. Then have it incline/decline over time depending on how you want the character to act in each situation.
I'm trying this as well, and I just need clarification. Are you saying that you need to manually have your update change the position dependant on how fast you want it to travel up and down? So in the frame the button is pressed it moves up a little, then the next frame it moves up less, and so on? That seems painful. Is there really now way to pretend like the character controller is a rigidbody, just adding force, or changing the velocity? All I want to do is push A, and the character controller jumps, but as it stands the move only changes the position directly.
Answer by Talmagett_Games · Jun 16, 2021 at 10:42 AM
maybe it helps https://forum.unity.com/threads/how-to-reset-the-velocity-of-a-charactercontroller.100240/
Your answer
Follow this Question
Related Questions
How to calculate the speed at which a rigidbody2d is actually moving ? 1 Answer
Velocity powered rigidbody on a moving platform without parenting. 3 Answers
Velocity for movement 0 Answers
How can my character stop moving immediately after it gets hit by enemy? 1 Answer
Modifying Gravity for Local Player 1 Answer