Simple scene, ball with rigibody and sphere collider ( lay on the ground ). Next to this is cylinder controlled by mouse ( forwar/back ) with mesh or box collider ( no matter what ). But this collider has “Is trigger” on.
Now the script attached to cylinder:
void OnCollisionEnter(Collision collision)
{
Debug.Log("Enter collision: " + Time.time);
}
void OnTriggerEnter(Collider other) {
Debug.Log("Trigger enter: " + Time.time);
}
void OnTriggerExit(Collider other) {
Debug.Log("Trigger exit: " + Time.time);
}
void OnCollisionStay(Collision collisionInfo) {
Debug.Log("Stay on collision: " + Time.time);
}
void OnCollisionExit(Collision collisionInfo) {
Debug.Log("Exit collision: " + Time.time);
}
void OnControllerColliderHit(ControllerColliderHit hit) {
Debug.Log("OnControllerColliderHit");
}
Simple ? Yes.
What does it do ? When I start the scene and move mouse very fast that in 2 or 3 ms it touches the ball i’ve got OnTriggerEnter log. But only once. I can move the cyllinder in every direction but no another OnTriggerEnter will show.
There is one more thing, when I start the scene and wait some moment ( ex. 1 sec ) and then move cyllinder to the ball nothing is happened … no collision, no trigger, nothing.
Now, is there a bug, problem, my stupid brain or something wrong ? Maybe the trigger must be release ?
I don’t get it. Can someone explain this to me.