📜  unity c# on trigger enter with specific gameobject - C#代码示例

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

代码示例1
void OnTriggerEnter(Collider other)
    {
        if(other.gameObject.name == "Object name") 
            //Object name is the name of the GameObject you want to check for collisions with.
        {
            //What you want to do on trigger enter
        }
    }