Why don't my projectiles collide with anything?
I created a script for my bullets. void OnCollisionEnter(Collision other) { if(other.gameObject.tag == "Enemy") { other.gameObject.GetComponent<EnemyType1Health>().DamageEnemy(damage); Debug.Log("Enemy Hit!"); Destroy(gameObject); } else { Destroy(gameObject); } }
Both the projectiles and the objects they are colliding with have colliders, and the bullet has a rigidbody. IsTrigger is enabled on both objects. Let me know if you need additional information.
Answer by RedRaiRobot · Dec 31, 2018 at 05:25 PM
Use OnTriggerEnter instead, and check the IsTrigger box for both objects.
Your answer
Follow this Question
Related Questions
How to make collision for the rocket launcer in singleplayer shooter? 0 Answers
Scene boundary loop 0 Answers
How to only make one explosion spawn on impact. 1 Answer
MY effect dont destroy 0 Answers
Who collided first 0 Answers