OnTriggerEnter not work

i put 2 gameobjects(A and B) in my scenes and set the component box collider.
then i make A move forward B with script,and add the following script to B:

function OnTriggerEnter (col : Collider) 
{
print("sth in!");
}
function OnTriggerExit (col : Collider) 
{
print("sth out!");	
}
function Reset ()
{
collider.isTrigger = true;
}
@script RequireComponent(BoxCollider)

and i hope when the A entered B, CMD show:“sth in”.
but when my A entered.nothing happened.

ps:

  1. i already add the box collider to A and B and set the B’s Trigger checked!
  2. when my First Person entered B.CMD show "sth in!"correctly!

why?!

Any trigger that moves needs to have a RigidBody also to work correctly. Set the RigidBody to Is kinematic and uncheck use gravity.

very thank you! :smile: :slight_smile: :stuck_out_tongue: