I have a box collider attached to a body. Now whenever a ball comes in contact this body. I want to produce a particle effect that has the color of the point of contact on the box body. Note that am changing the texture of the box body at run time and the color I need should be based on the texture at the time of collision(ie the color of the texture, at the point of collision).
Thanks
take the RGB values of the main color of ur shader, compare and make a result color.
I don't see why not. The 2 problems I can see are: 1) if your colliders are too different from the actual object (not a problem if you're actually using a box and a sphere) 2) if there is something blocking the raycast. Put all your blocks on a separate layer and use the layer parameter in your raycast function and you should be fine.
take the RGB values of the main color of ur shader, compare and make a result color.
– ManderSorry but thats not wat i want, I need the color of the texture
– stark89