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?
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’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.