RaycastHit[] hits;
hits = Physics.RaycastAll(transform.position, transform.forward, 100.0F);
int i = 0;
while (i < hits.Length)
{
RaycastHit hit = hits[i];
duck renderer = hit.collider.renderer;
if (renderer)
{
renderer.material.shader = Shader.Find("Transparent/Diffuse");
renderer.material.color.a = 0.3F;
}
i++;
}
this is from script reference
Assets/Scripts/AI.cs(77,12): error CS0246: The type or namespace name `duck' could not be found. Are you missing a using directive or an assembly reference?
WTF is duck??
In C# examples you get duck here:
I would bet “duck” was the catch phrase to look for when the auto translation of the Unity.js examples to C# failed. Not a likely word to have intentionally… but these were probably missed. They should be the appropriate type for the variable.

Worth a bug report? You do the honors?
Change duck renderer to var renderer.
That looks like the same code with the var change
Bah. Reported. And yes, duck is just a type. var works in Unity.js (and I think in some cases it does in C# now, as well…). If Var doesn’t work, you’ll need to statically type it…
Might be insightful (from Boo docs) …
"Along with the normal types like object, int, string…boo has a special type called “duck”. The term is inspired by the ruby programming language’s duck typing feature (“If it walks like a duck and quacks like a duck, it must be a duck”).
If you declare an object as type duck or cast to type duck, then boo will not try to resolve any methods or operations you call on that object at compile time. Instead it will convert those operations into methods that do not resolve until runtime. So at compile time it simply trusts that you know what you are doing (“it walks like a duck so it must be a duck”)."
The explanation for this is that Unity’s C# examples are indeed machine translated from the Boo examples. The translation is still not perfect however, and the word “duck” has been carried over unmodified from the Boo source. The docs are proofread but this mistake must have slipped through the net somehow.