I’m having problems with making triggers work when I move through them in game.
The game is meant to be turn based, so movement is produced by a grid of transparent squares encircling the player, and the player moves to the square that is clicked on via linear interpolation. I have various pickups and traps that are set up as triggers around the level, but for some reason when the player passes through them, they don’t trigger. However, when I START the player inside the trigger, or any other object for that matter, it will set off the trigger, just not in run-time. I have the code placed on all the triggers,the triggers all have a rigid body, the player does not. They both have box colliders.
This is the code for a random trap, very basic.
function OnTriggerEnter(other : Collider){
print(“collision happened”);
if (other.tag == “Player”)
{
other.GetComponent(Player).Die();
}
}
if anyone could let me know why it won’t trigger when the player Lerps through it, I would really appreciate it. Thank you.