- Home /
How to make FPS character move inside a building model?
I am trying to do something as simple as importing a FBX model of a building and making my FPS character to walk inside it.
I have no problem with the FPS character nor with importing the model. What I am having trouble with is to actually making the character walk inside the model.
I have tried applying a box collider and mesh collider with no effect. I have also tried making sure the character is inside the model and above it. Nevertheless, everytime the character falls through the building. It only stops if I have a plane under the building.
What am I doing wrong or simply not doing? Maybe some FBX import setting I need to set?
Thanks.
Well I think I might know what it is, but not how to fix it :) Your problem might be that the normals of the mesh collider are facing outwards I would guess. I'm supposing most internal scenes are constructed in the Unity editor out of parts - all of which have the normals pointing outwards because you are not supposed to be inside them. Very interested to hear about this...
I have tried to import the model and chaning the normals from "import" to "calculate" but had the same result. I am guessing that if the problem was what you are thinking I should be able to make the character walk on the top of the building, right? I can't do that, but maybe I am doing something wrong.
Ok, if you can't do that either then I'm definitely not right.
You added a mesh collider and it definitely showed your mesh in its selector? I've managed to add one before and not have the right mesh in it (no idea how)
You were right about not having the mesh selected on the $$anonymous$$esh Collider. I am a beginner to Unity as you can tell. Nevertheless, I now can see the mesh collider on the viewports, but can't get to scale it to the model size. The $$anonymous$$esh Collider appears at the center of the model, but like 10x smaller. If I try to resize the mesh, the model gets also resized.. Any idea?
$$anonymous$$aybe the model import settings - try setting Scale Factor to 1 - it's always set to .1 for me on FBX files.
Answer by whydoidoit · May 28, 2012 at 04:36 PM
We worked it out :)
@nuno needed to add a mesh collider and make sure that the mesh was actually selected in the mesh on the collider.
The mesh collider also needed to be added to a separate game object that was scaled, this is due to some factor about the import that I don't understand.