OnCollisionEnter but have colliding object not move the object it collides with

Is it possible to use OnCollisionEnter or detect collision otherwise without having one object affect the position of the other?

i.e., bullet A hits Object B, but Object B does not move, bullet A goes “right through”


OnTriggerEnter with isTrigger checkboxed for the bullet and rigidbody set for both objects:

Vector3 v = new Vector3(0,0,-3);

public GUIText t;

// Use this for initialization
void Start () {

}


// Update is called once per frame
void Update () {
	transform.Translate(v);
}


void OnTriggerEnter(Collider col){

	t.text = col.gameObject.name;
	
}

you can set for the GameObjects that are Colliding in the Collider component settings in the inspector “is Trigger = true”
and call OnTriggerEnter instead of OnCollisionEnter … so the colliders will “fly” or go through each other.

so this way Bullet A hits Object B, and Object B does not Move, Bullet A goes through :slight_smile:

also, try to debug yor collition/trigger

void OnTriggerEnter(Collider col){
   Debug.Log("Collision True");
   t.text = col.gameObject.name;
    }