Quote:
Originally Posted by TheTerran
Hello everyone, I need help with disabling up/down movement in my FPS game, because my collision detection uses a "move away from" motion to avoid going into buildings, which ends up forcing the camera upwards or downwards.
Thank you for reading this!
|
I think it would be smarter to prevent movement in a wall rather than using the move away from motion.
Using the distance checks, you could calculate the distance from your location to the wall in question. In your move methods, you check if your distance is greater than or equal to a certain object before moving to prevent moving past the wall. To get closer to the wall (without actually going through the wall) only move a calculated amount.