If 2 Object touch each other ,should be trigger or collision?
i write like this
void OnTriggerEnter(Collider col)
{
if (col.tag == "GameBox")
{
col.transform.rigidbody.constraints = RigidbodyConstraints.FreezePositionZ;
col.transform.rigidbody.constraints = RigidbodyConstraints.FreezePositionY;
col.transform.rigidbody.constraints = RigidbodyConstraints.FreezePositionX;
AddScore();
}
}
GameBox is the collider tag,
GameObject A GameObject B also is GameBox tag,
but din’t have any respon,
how?