- Home /
Switching gravities not that effective. Need help
So basically, when my player is on the ground, I need him to stay on the ground. So I put in a really big gravity amount. The thing is, when he walks down some stairs, he jumps off a little because he is going pretty fast. I cant have that happen for different reasons. Since this switching gravity doesn't work, how else can I keep him on the ground at all times????
Answer by SilentSin · Jul 26, 2014 at 04:50 AM
Changing gravity isn't a good solution to this particular problem.
I'd probably set it up so that the player constantly does a raycast down a short distance from just above his feet, and if that ray hits something then just snap their position down to put their feet at the hit point. Then if you need to jump, just stop raycasting until you land again.
Ok I will try that. I will tell you how it goes in a bit
Your answer
Follow this Question
Related Questions
Adding a jump feature help? 2 Answers
Jump Unpredictable 1 Answer
Jumping a specific height using Velocity & Gravity 1 Answer
[2D] gravity independant jumping 1 Answer
Getting this character controll script working right 1 Answer