this is insane, everything is named exactly as in the script and this is still not going of.
all objects including the missile this is on both have Box colliders and Kinematic Ridgidbodies.
(must have Kinematic or everything spins out and goes nuts)
no idea why this isn’t working yes the names in the scene are copied and pasted to the script so their the same and the DEBUG line triggers but the objects are not destroyed on hit.
using UnityEngine;
using System.Collections;
public class destroywepon : MonoBehaviour {
public bool Missile;
public GameObject MissileExplosion;
void OnCollisionEnter (Collision col)
{
if (col.gameObject.name == "FighterRedTeam") {
if (Missile == true) {
GameObject Clone;
Clone = Instantiate (MissileExplosion, this.transform.position, transform.rotation) as GameObject;
}
Destroy (gameObject);
}
if (col.gameObject.name == "DestroyerRedTeam") {
if (Missile == true) {
GameObject Clone;
Clone = Instantiate (MissileExplosion, this.transform.position, transform.rotation) as GameObject;
}
Destroy (gameObject);
}
}
}