📜  ontriggerenter unity 不起作用 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:52.259000             🧑  作者: Mango

代码示例1
void OnTriggerEnter (Collider other)
     {
         if (other.gameObject.tag == "Object") 
         {
             Debug.Log ("Collided");
         }
  
//at least one object needs a rigidbody, and a collider set to isTrigger.
//the problem may be that you put it in a void, you need to take it out of voids for it to work