Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm currently trying to create a game that involves the inside of a cube, which i will make in Maya. My question is what is the best way to create a model with hit detection in mind?

For example my model will be a cube that you can walk inside of, so should i make the cube as a one model or make one wall and put it together inside XNA?

The reason I ask this is because I'm sure that if I create a whole cube and then use XNA's bounding rectangle method, hit detection will always be true because the bounding rectangle will encompass the whole cube, making collision detection inside the cube non existent without the use of hard values.

Whereas separate walls would make the process easier because i will checking against separate walls instead of the whole thing.

To add to the problem, I also have doors in the walls so hit detection for the walls in that area need to be turned off.

enter image description here What is the best way to do this?

share|improve this question

1 Answer 1

You make the model however it needs to be made to appear correctly and/or animate correctly.

The collision shape does not need to be the same as the model and the collision shape can be a combination of multiple different shapes. If the inside of the cube is to be collided with, you can create collision shapes that just occupy the solid parts of the model, in this case, you would create rectangles that represent each of the walls.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.