Checking for Scripts in colliding gameobjects.

Hi
I need to check my OnTriggerEnter thing if it contains the script “PhysicsGround.cs” and then take the gamobject that I collided with and assign it to a varieble.

Please help and excuse my bad english.

You could tag every object that contains that script with the same tag…

Something like make the tag “Ground”

Then in your code do something like

void OnTriggerEnter (Collider other){
if (other.tag = "Ground"){
//action here
}
}

Can’t you just use GetComponent() on the object you collided with?

If it doesn’t exist, it returns null so check the return value. If it does, assign the object to your variable.