- Home /
What causes First and Third Person Controllers to stick on the ceiling?
What causes First and Third Person Controllers to stick on the ceiling for a second or so when they collide with it before dropping?
having trouble figuring out how to get it going back down right away
thanks!
Answer by Jessy · Jan 19, 2011 at 06:17 PM
The only thing that you have making them fall is gravity. Add something to your scripts to make their upward velocity go to zero when they hit the ceiling. The easiest way would be to check for CollisionFlags.Above.
Perfect, this answer is exactly what I needed! $$anonymous$$y player was on the ceiling and couldn't move anymore, but its velocity was still positive.
I find using "gravity * Time.deltaTime" (assuming you do the gravity in Update) instead of just resetting the velocity to zero to be smoother.
Your answer
Follow this Question
Related Questions
Sphere Controller Help? 1 Answer
Crosshair? How? 6 Answers
how do I move the 1st person controller by dragging the mouse 1 Answer
C# Crouch script problem 1 Answer
Can't get 1st person controller to stay on a platform. 2 Answers