Bounding boxes for collision

Started by
0 comments, last by Kryptus 20 years, 8 months ago
I''ve made a person walk around in a room and have set up bounding boxes around objects to stop my character from colliding with them, this is my problem. I have made the bounding boxes and done the test and it tells me that the character has hit the objects but i need to know how to stop him from going through them. My first attempt was around the lines of: If Character Has Hit Box Then Don''t Move Any Further. but this failed as you can no longer move out of the object you just collided with. please help me out.
Advertisement
Try checking for collision before the player actually hits an object. So instead of something like:

   MovePlayer();   CollisionTest( player.position ); 


you may want to try something like:

   SetDesiredPlayerPosition();   if( !CollisionTest( player.desired_position ) )      MovePlayer(); 

This topic is closed to new replies.

Advertisement