DragRigidbodyShadow script

Hey guys,
i’ve copied the DragRigidbodyShadow script from the SadowDemo Project and i’m tring to use on mine.
I’ve already setted the highlight material variable but i’m having this error: DrawMesh requires material.SetPass before!

Probably its something very simple but i’m new to unity =/
Any ideas?

Tks!

If you click on Highlight shader file (not the texture) you will see the following code in your text editor.

Shader "Shadows/Drag Highlight" {
Properties {
	_Color ("Main Color", Color) = (1,1,1,1)
}
SubShader {
	Pass {
		ZWrite Off
		Offset -1, -1
		Blend SrcAlpha OneMinusSrcAlpha
		Color [_Color]
	}
} 
}

Notice this line → Shader “Shadows/Drag Highlight”

This tells you where you could find it in the shader menu. Now go to the Highlight texture that you dragged on to DragRigidBodyShadow.js and double click on the Highlight texture. That will open up the Highlight inspector.

Click on the dropdown and select Shadows and then Drag Highlight from the sub menu.

That should take care of your error.