Question by
SQUARE-BADGER · Apr 14, 2016 at 07:03 PM ·
c#collisionerror
need help with colision problem
I made this code but the colision part is not trigered using UnityEngine; using System.Collections;
public class Bullet : MonoBehaviour {
//fly speed
public float speed = 2000.0f;
//explosion prefab (particles)
public GameObject ExplosionPrefab;
void OnColisionEnter(Collision col) {
Object.Destroy(gameObject, 2.0f);
Instantiate (ExplosionPrefab, transform.position, Quaternion.identity);
print ("it works");
}
}
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612074837im_/https://answers.unity.com/themes/thub/images/avi.jpg)