Search code examples
c#animationunity-game-enginespritecollider

How to increase the 2d collider size for animated object in Unity 3D


I have an animation object in shape of ball with different sizes. Think of it like a ball that increase in size from small to large but during the entire animation I want the size of the collider to remain constant through out the animation or always equal to the biggest sprite. How would I do that?

Thanks,


Solution

    1. To make sure that collider stays same size, make it a parent object to sprite. Sprite will be its child and this what you will be animating (making it bigger).

    enter image description here

    1. To display always in landscape mode, go to File -> Build Settings -> Resolution and Presentation -> Orientation

    enter image description here