Absolutely no collision detection in build but editor is fine
After several versions of my game, suddenly I have absolutely zero collision detection in my build. Everything works fine in the editor. Raycasts still work just fine, but its as if nothing has a collision layer. I move straight through enemies, and their bullets pass through me. Triggers don't work at all. I'm certain the issue lies in the collision detection, because I get no logs at all from anything. I had several incredibly weird issues with certain collision layers as if the settings were corrupt somehow, but I eventually got it to work at least in the editor. I just figured it would work in the build too which was a mistake I suppose. I really can't think of anything else to try. I've set everything to the default layer, removed tags and gone back to previous versions. Nothing at all works. I've read every post on google that comes up under this issue, but nothing has led me anywhere near an answer. I'd really rather not have my project haulted for another month due to a unity bug (it has to be a bug, right?). I've tried the whole "export the project" thing, but still no results. I'm using the most recent version of unity on windows.
Okay, so after some debugging, it appears that the collision matrix is completely clearing itself on runtime....???? I have no clue why this is, but when I manually re enable everything while playing, things work just fine (until I stop play mode, of course). None of my code changes any of the collision settings at all. I'm going to try to find a way to continually re-enable the layers until I find why this is happening.
Answer by FelixJones · Nov 07, 2019 at 03:14 AM
Apparently an ancient script I forgot I was using was doing some weird stuff with the collision matrix, because I never re-configured it. Hopefully it continues to work now that I've properly configured it. I'll leave the question up in case someone else comes along with a similar situation. TLDR; Always double check your own scripts before assuming its a bug!
Your answer
Follow this Question
Related Questions
my colliders don't work properly 2 Answers
2D Collisions Not Working,2d Collision not working? 0 Answers
Unity Collider2D is causing the game object to disappear upon collision? 1 Answer
Collision check 0 Answers
Collision With Text 0 Answers