Trigger Events

Hello

Just wondering if I am not understanding things properly - but do trigger events only fire off once?

I’ve modified the animation in the posted example www.otee.dk/joe/trigger.zip so that cube passes back through the collider which is a trigger.

I also added the following

function OnTriggerEnter (col : Collider) {
	print("Entering trigger");
}

function OnTriggerExit (col : Collider) {
	print("Exit trigger");
}

so that I could see when events were firing. The OnTriggerEnter event only happens once ( or appears to), am I misinterpreting the way these events should work as this appears to be the main reason why much of my current game is not working - I’m relying on the trigger events to fire off more than once.

Thanks
Jack

Hello,

if you need more then one trigger event try:

OnTriggerStay

Heinz

Hello HJPuhlmann

I’ve modified the script as such

function OnTriggerEnter (col : Collider) {
	print("Entering trigger");
}

function OnTriggerExit (col : Collider) {
	print("Exit trigger");
}

function OnTriggerStay (col : Collider) {
	print("Entering trigger (stay)");
}

and set the Animation wrap mode to ping-pong, but the trigger events still appear once in the console log?

Turn off “collapse” in the console. Triggers would be pretty useless if they only ever worked once. :wink:

–Eric

Doh! Thanks Eric - the mistakes one makes at 3 in the morning. This means the bug in my game is somewhere else!

Don’t feel bad…I think most people get bitten by this (I know I did). Probably would be better if it was off by default…

–Eric