How to fix a straight line collider

Just move the sprite shape while having Update Collider ticked.

The Update collider option is under the Sprite Shape Controller (was at the bottom for me), NOT under Edge Collider 2D.

When you add the Edge Collider 2D it defaults to a straight line, moving the game object forces it to update, editing spline should also work.

6 Likes

I had this as well, but updating the shape did not fix it. I believe the option that fixes this is Optimize Collider on the Sprite Shape Controller. I noticed in the video it was already enabled but it was not automatically enabled for me.

6 Likes

Confirming Optimize Collider fixed the issue for me. Thanks!

9 Likes

Optimize Collider was ticked by default for me. Unticking and ticking it again worked for me.

7 Likes

Thanks for sharing that. This fixed it for me.

I had Optimize and Update checked by default but it didn’t do anything until I unchecked and rechecked, for those still having issues. Also for some reason the offset was set to 0.5 - had to fix that too.

2 Likes

Draged Offset slider and it worked for me)

Thank you very much. I fixed it by turning off Optimize Collider (in Sprite Shape Controller when adding edge collider 2d) and then turning it back on.

Privacy & Terms