I’m in the process of making a mini-golf game. The ball keeps falling through the green and I’m a little lost as to how to fix it.
Here’s the scenario:
The hole is an fbx with a MeshCollider
The ball is a sphere with a rigidbody attached
When I run, the ball just seems to fall through the hole mesh. I’ve tried everything and can’t seem to get it to behave properly…any help would be appreciated.
I’ve also tried just using a cube instead of the hole mesh, and it seems to do the same thing…what am I missing?
Does it have a collider? A rigidbody only makes it use physics; it needs a collider to interact with stuff. Probably not a cube collider in this case though.
Are you using a separate collision mesh, or the actual green mesh itself?
The only reason I ask is that I’ve used a collision mesh before and found the normals were not facing ‘out’, causing it to ignore collisions on the way ‘in’. The 3d guy fixed it, but I had the collision mesh hidden and it vexed me at first.
Other than that, what kind of speed is the ball traveling at when it goes through? Is it falling at high speed?
edit->project settings->time->fixed timestep might help. that controls how often physics is triggered. if your object passes through another between timesteps the collision won’t be seen. try setting it lower but be careful as it will impact performance if you get too low. tessellation of the mesh collider can also play a factor.
After countless attempts I finally figured out what was going on. The problem was actually in the scaling of the mesh. The artist was using Maya and after some research I found that the Maya exporter renders at a much smaller scale than blender. All I had to do was up the scale on the mesh (on import) and everything works (after checking ‘convex’ of course)!
I’m a little confused though, perhaps some clarification would help: I always thought that scaling a mesh down wouldn’t have an effect on tesselation (considering the edges of each face on the mesh would be closer together). How come it works when I scale it up and not down? Shouldn’t it be the other way around?