- Home /
OnTriggerEnter only logs Debug.Log once, but is otherwise working fine
Hi
I was just wondering whats going on with OnTriggerEnter. It seems to be working fine, except it will only write debug log once, but all other code is working.
I have 2 scripts, first one is working and the player score is increased by 100 every time it's activated, but only logs once. The second one only has debug log in it and only logs once
Scripts:
public MainGameScript mainGameScript;
void OnTriggerEnter(Collider other){
mainGameScript.addToScore(100);
Debug.Log("Bonus Area");
}
And
public class GravityWell : MonoBehaviour {
void OnTriggerEnter(Collider other){
Debug.Log("Gravity Well");
}
It's pretty annoying if you are using Debug.Log to verify that something is working. It took me quite a while to realize that it was working even tho it only wrote log once.
Anyone know why and how to fix it?
Answer by Bovine · Jul 23, 2012 at 08:54 PM
Is your Console output set to Collapse?
Collapse eats repeats so that the window doesn't become cluttered.
He he, that's it. $$anonymous$$an that cost me some time :-)
Thx.