- Home /
Tilemap Collider Broken On Build
I created a Tilemap with a tilemap collider. I have a player character that has a BoxCollider2D and a RigidBody2d which is Dynamic. The hero moves using the rigidbody2d as "rb" and some Vector2 "v": rb.MovePosition(v).
In the editor this system works fine: the character moves and bangs into the wall tiles. But when I build the game, the wall colliders have no effect. The hero moves through walls. What's the problem here? Why is the behavior different between the editor and the build? This is with Unity 2017.2.0f3, WebGL build.
Answer by KrisSchnee · Feb 24, 2018 at 05:30 PM
I did some digging. For anyone finding this later: apparently you need to select the textures you're using for your tiles, and in the Inspector, in the "Advanced" section, mark them as "read/write enabled". It worked for me.
There is no proper documentation for this bit of voodoo, and it makes no sense that Unity's editor doesn't work the same way as the build, because that defeats the purpose of having an editor. Notice by the way that in the video series about a platformer using tilemaps, they're using some weird custom movement code that doesn't handle colliders normally. This problem is an unfixed Unity bug.
Thank you, I was going crazy. Weirdly enough part of my colliders actually worked before, even though they had read(write disabled, but enabling it on the others fixed it.
Been trying to fix this for months and finally stumbled upon your answer - worked like a charm! They need to fix this!
Almost 3 years later and this is still the fix for it. Thanks for this!
Thank you so much! in 2021.1.4, and after days of searching, you have saved my game! Thank you so much, and they REALLY need to patch this!!
Your answer
Follow this Question
Related Questions
Can isometric tiles be rotated? 0 Answers
How to store tile's rotation? 1 Answer
My 2D tiles have holes in them 0 Answers
Why is my tile palette do messy?,Why is my tile palette all messy? 0 Answers