Hi everyone I’m new about Unity and I’ve a problem with the detection with a prefab object.
This prefab has 1 script to activate him childrens, one of them has a capsule collider and line renderer components.
The script activate correctly the line renderer and capsule collider but when my character hit something the collision is not detected although I have insered OnCollisionEnter method.
// Use this for initialization
void Start() {
}
// Update is called once per frame
void Update() {
}
void OnCollisionEnter(Collision collision) {
Debug.Log(collision.gameObject.tag);
}
Collision events are only sent if one of the colliders also has a non-kinematic rigidbody attached.
As i can see, OnTriggerEnter is the same, so the only way to solve this is to attach RigidBody to the enemies or the Lightsaber.