What did I do wrong
Assets/raycastscript.cs(13,31): error CS0131: The left-hand side of an assignment must be a variable, a property or an indexer
RaycastHithit;
floattheDistance;
Vector3forward=transform.TransformDirection(Vector3.forward)=10;
Debug.DrawRay(transform.position,forward,Color.green);
if(Physics.Raycast(transform.position,(forward),outhit)){
theDistance=hit.distance;
print(theDistance+“”+hit.collider.gameObject.name);
}
}
}
use code tags when pasting into the forums, it wont butcher the formatting then: Using code tags properly - Unity Engine - Unity Discussions
also it would be useful to know which line that error message is referring to (you didn’t include the whole script so the line number wouldn’t help even if you had used code tags which adds them in).
That said;
Vector3 forward =transform.TransformDirection(Vector3.forward) = 10;
this is just wrong… what were you trying to do here?