#pragma strict
static var isdodge : boolean;
var direction;
var hit : RaycastHit;
var estranho : GameObject;
function Start () {
direction = transform.TransformDirection (Vector3.up);
isdodge = false;
}
function Update () {
Debug.DrawLine (transform.position, hit.point, Color.red);
if (Physics.Raycast ( transform.position, direction , hit,20)){
isdodge = true;
I’m trying to assign true when isn’t colide anymore
if (!Physics.Raycast ( transform.position, direction , hit,20)){ == does’nt work
isdodge = false;
i tried use else,but doen’t work properly,someone could help me?
thanks in advanced