- Home /
2d collision according to sprite image
Hi,
I'm a unity noob and sorry if this question seems a bit stupid.
Basically, is there a way to have collisions match the sprite map?
I'm making the flappy bird clone from the Playmaker tutorials as a learning project. Not thinking much about collisions I designed my 2d character to be dog shaped in profile... big head, tiny body and legs... not cube or capsule shaped so currently the collision detection is larger than the image area.
The sprite map isn't animated, it's just one alive and one dead image, but it would be nice if there was individual collision detection on both.
The only way I can think of now is to model two planes in blender to suit the images, but this doesn't seem like the best way to approach things if I was making a game that had many sprite animations.
I would just like to know what would a seasoned Unity pro would do.
Thank you.
Answer by Adamcbrz · Mar 19, 2014 at 04:20 AM
With rigidbodies any collider parented to that rigidbody is also considers as part of its collision region. So you can use that to create complex shapes using several primitive colliders. Also if you are using 2D physics you can use the polygon collider and define the shape of the collider.
Your answer
![](https://koobas.hobune.stream/wayback/20220613140619im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Collider just for Tag (2D) (C#) 1 Answer
How do you change a variable in a script, that is on an object instantiated from a prefab? 0 Answers
OnCollisionEnter2D/OnCollisionStay2D only detecting collision with the ground 1 Answer
2D Detect collisions of a 2D block only on left/right (not top/bottom) 0 Answers
Objects don't collide 1 Answer