im trying to draw a line between objects 1 and 2 if there is something between them. yet nothing can be detected. the physics.linecast was taken from the unity script reference.
any help is good
void Update ()
{
if(test ==1)
{
Debug.Log("test has returned true");
Debug.DrawLine(object1.position, object2.position, Color.blue);
}
}
void FixedUpdate ()
{
Debug.Log("testing line between 1 and 2");
if (!Physics.Linecast(object1.position, object2.position))
{
test = 1;
}
else {Debug.Log("found nothing");}
}
}
356459–12395–$assets_626.zip (4.9 KB)