Space Game 'Lander' Coding

Im new to Unity and as my first attempt at a game after completing the first few tutorials I have set about making a game based on good old Lander.
So far Ive got my ship flying and it explodes satisfyingly when the green section of the ship hits the ground but I am stumped trying to make the Java to detect that the red landing legs have landed on the goal and are stationary.

I think the best way to do it is a on OnTriggerEnter with the finish and to check if the rigidbody ship is on in sleep. I have placed a trigger in the group that makes up the ship that juts out below the feet and so far I have made this script.

var ship : Transform;

function OnTriggerEnter (other : Collider) {
if (other.CompareTag (“Finish”) ship.rigidbody.IsSleeping()) {
Debug.Log (“You Win”);
}
}

But it dose not seem to want to work

Any better idea’s or suggestions?

At the time the lander’s foot enters the trigger, it will still be moving, so it won’t be asleep. Try using OnTriggerStay instead.

Hu… not too sure, never used IsSpleeping() before, but I think OnTriggerEnter isn’t the way to go.
The way I see it, when you ship enters the collider, it can’t be sleeping, since it had to move to get to that landing platform, right?
But like a fraction of a second after that, it could be sleeping… but then you’ve already entered the collider. So you could try OnTriggerStay instead?

But anyway you’ll have to destroy your ship if it enter the collider too fast (game over), right? So maybe you should forget IsSleeping, check the ship’s velocity on enter, and win if it’s below a certain speed, lose otherwise.

I defiantly get the destroying the ship if its velocity is to high. But that dose not need to be specific to the landing pad.
What I need to do is test of the Lander is on the pad and sitting still before I declare the game won. I think OnTriggerStay is the way to go but how to tell if the ship is sitting still?

You can check to see if an object’s velocity is 0 (or maybe just a small value, so it doesn’t have to be totally 100% stopped, just close enough).

–Eric