📜  如何使对撞机与某些事物发生碰撞,但与其他事物不发生碰撞 - C# 代码示例

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

代码示例1
//ignores all collisions between the object collided with and the 
    //gameobject that this script is attached to

Physics.IgnoreCollision(
    collision.gameObject.GetComponent(), 
    gameObject.GetComponent());