I have a 2D side-scrolling platformer where a skater is jumping over crates. At the end of the level, I need the player to advance to the next level. The problem is that none of the scripts I’ve tried work. I have a plane sitting vertically for the player to enter and activate. On the plane, I have this script:
var levelLoaded : int;
function OnTriggerEnter(other : Collider){
Application.LoadLevel(levelLoaded);
}
The plane has a box collider on it, and “is trigger” is checked. The skater has a box collider and a rigidbody so it can collide with the crates (rigidbodies and box colliders). Anyone know why the script won’t work?
I found the answer! The skater has to be moving for whatever reason. All of the other objects are moving instead of the skater because I’m stupid and that’s what I wanted to do. So, I just made the skater have a line of code that moved him 0.001 units forward.