Changing terrain texture on contact (collision)

I need to change a terrain’s texture at the point it collides with a specific object. How can I achieve that? Thanks in advance! :slight_smile:

P.S. Adding grass or terrain details at that point would also work for me! :slight_smile:

Use OnTriggerEnter or OnCollisionEnter and check to see if the collision happened with the object/object type you want to change the texture of. You should then be able to get the material component and use Material.SetTexture to change it to whatever you need it to be.

http://docs.unity3d.com/Documentation/ScriptReference/20_class_hierarchy.html

I have the same problem. Please tell me if you figure it out!