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 working on a little ramp and ball game in Unity, I modeled the ramp outside Unity and exported it to a .FBX file, then I imported the ramp in to Unity. I set up the ball and ramp, both have Rigidbodies, Ramp is set to isKinematic = true, yet when I play the game the ball just falls right through the ramp and hits the floor below it fine. So it's something wrong with the ramp.

Am I doing something wrong? Are .FBX files unable to apply physics?

Thanks,

Tim.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Yes you can apply physics to a fbx derived mesh. Make sure the mesh has a MeshCollider and the ball has a SphereCollider.

Make sure you have the Generate Colliders option checked:

FBXImporter Options

Also make sure that the Mesh for the ramp is set in the MeshCollider on your GameObject:

MeshCollider

share|improve this answer
    
Yup, the mesh has a MeshCollider and the ball has a SphereCollider –  Timothy Williams Mar 30 '12 at 10:50
    
Make sure the ball's SphereCollider is not intersecting the ramp's Collider or it will just fall through it. Can you post a screen snap of the scene? –  Rubber Mallet Mar 30 '12 at 13:57
    
It's not, for testing I have the ball fall on a surface that does work (the red pillar) roll off that on to the ramp, but it just falls through the ramp and hits the floor. picture –  Timothy Williams Mar 30 '12 at 18:27
    
Thank you SO much, that did turn out to be the problem. Marked correct. –  Timothy Williams Mar 30 '12 at 18:46
1  
This is a fine solution, but consider to use a rotated box collider on top of your mesh. Mesh colliders are'nt as robust to physics as box colliders and even more important box colliders are perform much better. If you need use a lot of meshcolliders your game performace will definitly drop. –  jonas Apr 13 '12 at 11:24
show 5 more comments

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.