How do I get the Box Collidor to form around the shape of the Sprite?
I am creating an angry Birds like game with Physics objects. I have set up the rigid bodies and box colliders around them. The problem I'm having is that the box colliders form ... well a box around the sprite. However, I want the collider to form around the shape of the sprite/artwork. How do I this? Otherwise the result is the objects push against each other when the game starts and the structures fall down before the game starts. How do I fix this?
Answer by tanoshimi · Nov 15, 2016 at 12:46 PM
Sounds like you want to use a Polygon Collider 2D instead.
Answer by roman_sedition · Nov 15, 2016 at 10:30 PM
I have a somewhat lazy solution .
If your sprites are smaller than 126 x 126, you can import your .png of the sprite into magicavoxel, and then export your voxel model of your sprite into unity and select 'Generate Colliders', which will put a meshcollider around the whole of it. Since your game is 2D and is in orthographic mode I don't think it should matter too much substituting a voxel model for a sprite. Unless your sprites are heavily animated.. then this could be the really laborous way.
Your answer
Follow this Question
Related Questions
Getting name of Spritesheet on runtime with C#? (Not individual SpriteName) 1 Answer
Sprite Editor doesn't zoom out far enough 1 Answer
Could use some help with slicing a sprite sheet 0 Answers
Is there any possible way to let my players use their own sprites? 0 Answers
Texture Packer vs. Sprite Packer 3 Answers