Collision problem (68018)

Hello.
I’ve been following this example to the letter.

Everything’s been working well until I got to the end with the collision.
Code seems totally fine, I double checked to make sure the bomb was a rigid, and tweaked the coordinates to make sure it was hitting.
The bomb goes right through the shark model, but nothing happens.
Deprecated code? It’s hard to debug because code has no errors, and double checked the naming of the targets as well.

Here’s the collision code.

void onTriggerEnter(Collider obj)
	{
	if(obj.gameObject.name == "Shark") {
		obj.gameObject.transform.rotation = Quaternion.identity;
		obj.gameObject.transform.position = new Vector3(20f, -3f, 8f);
		Destroy(this.gameObject);
		}
	}

2 Answers

2

OnTriggerEnter() will be fired when a proper trigger event is entered. You should check the Collision action matrix table at this page to see if your collider/triggers are properly setup.

Main setup I have is one object with trigger on, that’s a prefab with Rigidbody.
Everything else is pretty much stock objects with a collider object, no trigger, no rigidbody.

The matrix looks like this might not match up, but I’ve altered it to match what I consider to be a positive in the matrix, to no avail.

I feel like this is a super simple fix, but something is just overlooked or wrong.

Here’s my code if that helps.
https://www.dropbox.com/sh/m3prep5f5ywtww9/FZeSaaJWL1?dl=1