To get into unity I’m copy-pasting stuff from the ShadowDemoProject into my own project. Things go pretty well and I really begin to feel the power of unity, but there’s one thing I cannot solve right now:
I’m using the highlight function from DragRigidBodyShadow.js:
function OnPostRender()
{
if( highlightObject == null )
return;
var go = highlightObject;
highlightMaterial.SetPass( 0 );
var meshes = go.GetComponentsInChildren(MeshFilter);
for( var m : MeshFilter in meshes )
{
Graphics.DrawMeshNow( m.sharedMesh, m.transform.position, m.transform.rotation );
}
}
but always get the error: DrawMesh requires material.SetPass before!
Can anyone please explain what this means and how I can avoid this?
Thx a bunch
Ekki (unity Newbie)