my computer keeps on saying that i don’t have a semi colon at the end of lines 3
My Scripts Below:
#pragma strict
function Update () {
var hit=RaycastHit hit;
}
if(Physics.Raycast(transform.position,transform.forward(hit,20))){
print(hit.collider.tag);
if(hit.gameObject.tag==(“porte”)){
hit.collider.gameObject.animation.Play(“animation+porte”);
}
}
I don’t know the problem PLEASE HELP!!!
I cleaned up your code so you can see what’s actually going on and replaced the (hit,20) with the proper usage: hit, 20
Also Raycast hit should not be “var hit = RaycastHit hit;” you need a colon instead of equals. And no second definition, you’re mixing in C#.
function Update ()
{
var hit : RaycastHit;
if(Physics.Raycast(transform.position,transform.forward, hit, 20))
{
print(hit.collider.tag);
}
if(hit.gameObject.tag==("porte"))
{
hit.collider.gameObject.animation.Play("animation+porte");
}
}