- Home /
How Do I Partially Change The Material of An Object On Collision?
Hi! I know this is quite a difficult question to ask since I've been searching for a way to implement this for several weeks, but I have to ask it or my soul won't be at peace
I'm trying to make a 3D multiplayer game wherein the color of an object changes when "painted on". That would mean that I'll need to partially change the material of an object dynamically. Is there any way to do this in non-expensive ways since the entire scene is filled with "paintable" objects?
I'm trying for something similar to the attached image's effect. (note that the game doesn't actually use paint, but I'm looking to change only part of a material on collision)
I did some research and found out that the effect I wanted is one where only the objects inside the sphere gets rendered.
I'm still quite new to Unity so I might have overlooked the correct resources. Please do point me to them, if ever. Thanks!
Hi there, have you found a solution to this problem? I'm looking for the exact same solution.
Answer by jdean300 · Aug 15, 2017 at 01:54 AM
I'm almost positive you'll need to write a custom shader for this. As a parameter for the shader you could pass in a location and a distance and any vertex within the specified distance from the location could have it's color modified. I can't give more specifics than that because I'm pretty terrible with shaders but this may help you.
Hi! Sorry for the really late reply, but this isn't really what I had in $$anonymous$$d. I've been researching on how to render only the objects inside a certain area(that collider). Is there any way to do that?