简体   繁体   English

如何在Unity 3D中增加动画对象的2d对撞机大小

[英]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, 谢谢,

  1. To make sure that collider stays same size, make it a parent object to sprite. 为了确保对撞机保持相同的大小,请使其成为Sprite的父对象。 Sprite will be its child and this what you will be animating (making it bigger). Sprite将是它的子级,这就是您要设置动画的效果(使其变大)。

在此处输入图片说明

  1. To display always in landscape mode, go to File -> Build Settings -> Resolution and Presentation -> Orientation 要始终以横向模式显示,请转到文件->构建设置->分辨率和演示文稿->方向

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM