I am making use of OnTriggerEnter(Collider other), is there a way to get access to the script attached to my other gameobject without explicitly writing the name of the script? my code is:
void OnTriggerEnter() { other.attachedRigidBody.GetComponent(); }
void OnTriggerEnter()
{
other.attachedRigidBody.GetComponent<xyz>();
}
In the above code, after GetComponent and before parantheses, there are angular brackets with xyz written. Somehow, it's not visible in the code. xyz is the name of the script attached to other, but I don't want to write xyz, but rather want to find a way to make my other gameobject implicitly look for whatever script is attached to it.