手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

Unity如何碰撞物体消失

时间:2024-10-12 11:29:23

1、首先打开unity软件

Unity如何碰撞物体消失

2、然后我们选择新建一个项目

Unity如何碰撞物体消失

3、我们添加三个物体(两个正方体和一个圆体)

Unity如何碰撞物体消失

4、新建一个脚本文件命名(自己定义)

Unity如何碰撞物体消失

5、我们输入:(如图所示)if (other.tag == "one") { Destroy(other.gameObject); }

Unity如何碰撞物体消失

6、最后播放就可以看到效果啦

Unity如何碰撞物体消失
© 手抄报圈