I have a player with mesh collider and a terrain with terrain collider.
My player has rigidbody attached wich is Kinematic. In the mech collider, the IsTrigger is checked. I have an other cube, with cube collider.
If i go through the cube, in the log i see “Colled”, but if i go through the terrain, i cant see anything.
My code is here:
void OnTriggerEnter(Collider col) {
Debug.Log("Colled");
}
void OnTriggerExit(Collider col) {
Debug.Log("Exit");
}
void OnTriggerStay(Collider col) {
Debug.Log("Stay");
}
I want to see Colled in my Log, if i go through the terrain. Thank you for the help!
I tried tonns of solutions, i cannot solve the problem!
– MrAkroMenToSNvm, I tought your terrain has the mesh collider. Did you attached this script on the object you want to fire it?
– gajdotAs i wrote, it worked with the cube collider.
– MrAkroMenToSIt worked, but if i use Convex mech collider, i should use box collider too, so it is not necessary to use mesh collider, but i want. How can i trick the system?
– MrAkroMenToSI solved! Thank you for help gajdot, you should make it as answer, and i'll tick it for a good answer.
– MrAkroMenToS