- Home /
How to move a character slowly over a certain spot
i am making a game and would like have the player be slowed when going up stairs and down them. I'm not to sure how to do this and i have looked at quite a few things but haven't found what i need. if someone could help me that would be awesome!!
Answer by theANMATOR2b · Jan 22, 2017 at 01:43 AM
I'm not a coder - but I'll give a couple ideas. If you already have your character moving - then you could modify the code to say something to the effect, when character is moving a Y direction make speed (this) instead of (this).
That might effect any jumping movement if he happens to jump, so rather than moving in Y direction you might be able to say - if character is moving at this angle, slow the character movement speed by .5. As long as the stairs are all at the same angle - the only time the character will move at that reduced speed is when he is on the stairs.
Alternatively you could create a trigger colider that encompasses the stairs. Whenever the character enters the trigger, his movement speed is reduced the desired amount.
Your answer
![](https://koobas.hobune.stream/wayback/20220612105234im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Character Controller slowing down after climbing a slope 1 Answer
Climbing stairs and climbing on a slide 0 Answers
character creation 2 Answers
switch player and npc follow player 0 Answers