At first sry for my Bad English, i´m German !
Ok, i programming to Time in my Lifestatus the Damage. For Damage by Flowers etc i use the Trigger Methode. Now ich have the Code
function OnTriggerEnter( col : Collider )
{
if(col .name == "kaktus"){
Leben--;
}
}
it is Javascript ! And Unity say follow :
What is this ? I have the same Code in a other Game an there Nothing Error came.
Greets Paddy
The whole Script lebenslust.js is:
var Leben : int = 10;
var Herz : Texture2D;
var MaxLe : int = 10;
var Abstand = 10;
var Groesse = 20;
function Update () {
if(Leben > MaxLe){
Leben = MaxLe;
}else if(Leben <= 0){
Application.LoadLevel(0);
}
}
function OnGUI() {
for(var t = 0; t < Leben; t++)
{
GUI.DrawTexture(Rect(0+t*Abstand,10,Groesse,Groesse), Herz);
}
function OnTriggerEnter( col : Collider )
{
if(col .name == "kaktus"){
Leben--;
}
}
}
You have placed your OnTriggerEnter method inside OnGUI, which you cannot.
Ohhhh I should be ashamed of myself.
Thanks SchneiderAtvis 
But mhhh I’ve got the problem now that he did not deduct the lives I touch the cactus. And suddenly you can run again this is because of the trigger function? And if so I can calculate the damage differently?
I thank you for your help 
what code have you got now?
What do you mean by:
what should it do?
I have a cactus in German Kaktus. When my Player touched him or approach comes, the player become 1 Damage. That i do with
function OnTriggerEnter( col : Collider )
{
if(col .name == "kaktus"){
Leben--;
}
}
but when i run to this cactus and running against the cactus (deutsch: durch den kaktus) then is calculated for some reason no damage. And no Collision ist there
is this script on the player or is it on the kaktus
Is the kaktus collider set to ‘is trigger’