detecting rigidbody collsion with no extra script

Hello All.

I am interested into accessing collision status of rigidbody with no extra script attached onto it, and which is not working with event.

I am currently having something theorically like this

public class MyClass: MonoBehaviour {
	Rigidbody PositionReferenceA;
	Rigidbody PositionReferenceB;
	void Start () {
		PositionReferenceA = (Rigidbody)(new GameObject()).AddComponent("Rigidbody ");
		PositionReferenceB = (Rigidbody)(new GameObject()).AddComponent("Rigidbody ");
	}
}

And I would like to have something like this in my class :

void Update() {
	if(PositionReferenceA.IscurrentlyColliding()==true)
		//do stuff here
}

Is there anyway to do this?
I don’t see any accesser like this for the rigidbody class, but maybe there is a tricky way to do this?

Thanks for your time.

Hello,

Other than writing your own rigidbody classe, there is no possible way of achieving what you want. You will need to attach a script to it, in order to test for colisions :slight_smile:

Hope this helps,
Benproductions1