There is an object to which a specific script is attached, and there is another object with a script. When the first object collides with any other object, you need to check whether the other object has the script attached to the second object. How to do it?

    1 answer 1

    void OnCollisionEnter(Collision col) { if(col.gameObject.GetComponent<FirstScript>()) { //do } }