Dynamic Batching and Object-Position

Hi all,

I’m experimenting with a vertex animation shader, that animates the vertices based on the object position. Unfortunately the _Object2World matrix gets zero, when the objects are dynamically batched. Is there any way to get this position/transform in another way?

Thanks
m.arc

Ok… this works:
Saving the the relative Vertex Position in uv2/uv3 and then subtracting those coordinates from the vertex position in the shader.

You can use “DisableBatching” = “True” shader tag.

EDIT: For unity 5