Trigger no longer registering scenery

I’m at my wits end here. I have a player collider which suddenly refuses to detect the scenery in my level.

It was working fine only yesterday. I made a few changes to meshes and object orientation and now it doesn’t work. No changes were made to collision matrix or layers.

OnTriggerEnter simply fails to detect the scenery all of a sudden. The maddening thing is, the collider will detect pickups, but not scenery. The only way it will detect scenery is if I replace the scenery mesh collider with a box collider - not very useful.

Does anyone know why my mesh colliders could suddenly have stopped working?

No, but here are some pointers to remember.

Its most of the time better to build box colliders to mimic your scene than it is to use mesh colliders. Meshcolliders are very heavy and may have a negative effect on your game’s proformance.

Make sure your collider is not inside of another collider, that your collider does not have an ignore physics in the code, that if you have a rigidbody attached to the player, that is is not kinetic, colliders only work with a none kinetic rigidbody.

If all that does not work, I would try to retrace your steps and undo the changes you did to see what the problem was as well as re-importing the mesh.

I hope that helps.

Thanks,

I’m using mesh colliders as it’s not practical to mimic my scenery with box colliders - the game uses virtually no physics so no worries on performance - runs at constant 40fps.

My player collider is set as a Trigger and I am testing for other objects colliding using OnTriggerEnter.

I simply want to know if the player object bumped into another object - I don’t need any physics at all. Do triggers detect if a mesh collider has entered the trigger?

I’ve double-checked the collision matrix.

I’ve reimported the meshes and the changes I made really shouldn’t have affected collision detection - I simply rotated the original meshes in Blender then reimported them as well as changing from a 1st person viewpoint to a 3rd person viewpoint.

It’s odd. A few days ago it was all working fine… I am stumped.

Solved it… replaced Ship Mesh collider with Sphere (which I originally used) and it works again.

Mesh Colliders cannot collide with each other.

Ok, some points:

  • The whole collision/trigger-system is part of the physics system.
  • Collisions or trigger messages can only be generated by non-kinematic rigidbodies when they are awake.
  • If a non-kinematic RB don’t move for a while (1-2 sec) it fall asleep.
  • If the RB is moved, or hit by another rigidbody it wakes up.
  • kinematic rigidbodies can wake up other non-kinematic rigidbodies in order to have the physics calculated.
  • If you move a normal collider ( without rigidbody ) into a sleeping rigidbody no collisions are detected.
  • Normal(non-convex) MeshColliders can not collide with other MeshColliders.
  • Only convex MeshColliders can collide with other non-convex MeshColliders.

Since you always need a non kinematic rigidbody you should add this one to the moving object. A Rigidbody represents a moving physics object.

Player characters normally are build with primitive colliders. In most cases (like the charactercontroller) it’s just a capsule.

If it worked before you may had the collider turned into a convex collider.