hi there,
i know there are some threads about this but i cant find the help i need in these.
hope you can fix my problem. ![]()
in my script i get always the " β;β expected. Insert a semicolon at the end." Error but the line is (14,14)

hi there,
i know there are some threads about this but i cant find the help i need in these.
hope you can fix my problem. ![]()
in my script i get always the " β;β expected. Insert a semicolon at the end." Error but the line is (14,14)

You have a mixture of UnityScript and C# syntax. Assuming this is a UnityScript, line14 should be:
var myColor : Color = new Color(0,0,1,1);
This should help you:
#pragma strict
function OnCollisionEnter (col : Collision) {
if(col.gameObject.name == "Boden"){
ColorTest();
}
}
function ColorTest () {
var myColor : Color;
myColor = Color(0.2F, 0.3F, 0.4F);
if(this.gameObject.renderer.material.color == myColor){
Destroy(gameObject);
}
}
this error is now gone but another appears. "unexpected token: myColor." [32177-hilfe.jpg|32177]
β _TeZeReplace your myColor line with the following; var myColor : Color; myColor = Color(0.2F, 0.3F, 0.4F); Or simply copy my the code from my comment down below.
β anon50064078@-teze - updated - I missed off the "var" :)
β tanoshimithank you all :)
β _TeZe