3D Platformer, problem with collider script to complete level

Hello. I’m a beginner on using Unity (using the free version), and I’m having a problem with getting a collider to end the level. I’m using the Lerpz tutorial as a base for my scripting (pretty much copying the script but switching in my group’s built visual elements), and I have it set up so a circle pad on the floor will become a trigger when 0 collectible items are remaining, and when the player runs into the mesh collider, it will trigger a second camera to activate. I can get the pad to become a trigger when 0 items are remaining, but even if I have the player character jump up and down on/through the pad, the collider won’t activate and the second camera won’t activate. I’ve doubled checked my functions several times, but it’s just about line for line the same as the Lerpz tutorial.

I’m pretty sure that the player script is linked to the levelstatus and Spaceshipcollider script (the unlockexit function seemed to execute fine when 0 items remained (although the camera would never shut off so I just got rid of that function)), so I’m not entirely sure what the problem is.

I have little experience with programming, so if anyone could help me try to figure out what the problem could be, that would be great. I think it has something to do with the Spaceshipcollider script and the trigger pad that it’s connected to, but I’ve tried fussing with it for hours and nothing works.

In case it’s important, the level itself is its own object in the Hierarchy tab, and the trigger circle is a child object of another game object.

Be carefull to translate directly the scripts from one tutorial to your own project because many times you have to modify a lot of things and it can be tricky. I hope you have completed first the Lerp tutorial to understand it.
Anyway the process with Triggers is simple:

For example:

function OnTriggerEnter (other: Collider){
if (other.gameObject.CompareTag(“Player”){
if (other.GetComponent(ItemScript).myitems>5)
Application.LoadLevel(“newLevel”);
}
}

Here if the player (properly taged in the Inspector as “Player”) enter the Trigger if he has collected all the 5 items the actual level finish and the new level is loaded. If the items collected are less than 5, nothing happens.
I recommend you to simplify your scripts and when the basic is working add more things…

Sorry I don’t know if you were asking this…

Good Luck :slight_smile:

Yeah… I knew I should have been careful, but things were going relatively well before this hiccup. Everything’s labelled and tagged right in the Inspector as far as I can tell.

The code I was using from Lerpz was:

private var playerLink : ThirdPersonStatus;

function OnTriggerEnter (col : Collider)
{
	playerLink=col.GetComponent(ThirdPersonStatus);
	if (!playerLink) // not the player.
		{
			return;
		}
	else
		{
			playerLink.LevelCompleted();
		}
}

I changed it to

	private var playerLink : ThirdPersonStatus;
	private var levelStateMachine : LevelStatus;

function OnTriggerEnter (col : Collider)
{
	if (gameObject.CompareTag("Player")) 
		{
			levelStateMachine.LevelCompleted();
		}
	else
		{
			return;
		}
}

STILL not working. I’m wondering if I should just try to put everything into the LevelStatus script, although I’m not sure how to go about doing that.