网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

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如何碰撞物体消失
© 2025 智德知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com