UnityException:标签:未定义 [英] UnityException: Tag: is not defined

查看:30
本文介绍了UnityException:标签:未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注

I'm following the Unity Roll A Ball Tutorial but I'm having an issue picking up the spinning objects. Whenever I roll over them I get this error:

UnityException: Tag: PickUp is not defined. PlayerController.OnTriggerEnter (UnityEngine.Collider other) (at Assets/Scripts/PlayerController.cs:30)

I've made sure my tag PickUp is exactly the same as in the code, and still it doesn't work. I've been trying to fix this for a long some so any help is appreciated.

解决方案

You have to add the tag(PickUp) from the Editor before you can reference it from script.

这篇关于UnityException:标签:未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆