OK, I’m a rank newbie here (my background is modeling and animation), so it’s probably safe to say the I’m being an idiot here, and my problem is really simple.
I’m doing the 3D Platform tutorial, and I’m at the end, at the cut scenes portion. I’ve got two scripts that apparently won’t compile. When I try to add the HandleSpaceshipCollision script to the spaceship, I get the error message: “Can’t add script behaviour HandleSpaceshipCollision. You need to fix all compile errors in all scripts first!” The LevelStatus script doesn’t reflect all of the additional variables that were added; the only one that shows up is the original “Items Needed” variable. I’m guessing that this is also a compiling error.
So…here’s the HandleSpaceshipCollision script:
private var playerLink : ThirdPersonStatus;
function OnTriggerEnter (col : Collider)
{
playerLink = col.GetComponent(ThirdPersonStatus);
if (!playerLink) // not the player.
{
return;
}
else
{
playerLink.LevelCompleted();
}
}
I copied this right out of the tutorial (cut paste) so I’m not sure what’s wrong, or why.
I’ll put the LevelStatus script in the next post so that they’re separate.
Thanks.