- Home /
Highlighting areas of an object in contact with another?
Hey all. First time posting yet a long-time lurker on here.
No point in babbling, onto the question. I'm wondering how you would highlight on an object — a sphere for example — the areas that are touching other objects. To further the sphere example, let's assume there's a plane as well. So the sphere is placed a bit off center along the horizontal plane. What I'd want is for the outsides of the sphere to be highlighted, and given a special glow-y texture of some sort.
This has just been one little trouble I've had while I've been thinking through the next step for a small project I've been working on.
I appreciate any help, and if you need me to clarify my example (it made sense in my head!) feel free to ask.
Thanks much.
Answer by whydoidoit · Apr 11, 2013 at 02:57 AM
You can iterate through the points of contact in a collision situation and draw those, they're a member of the Collision object passed to the OnCollisionEnter etc...
http://docs.unity3d.com/Documentation/ScriptReference/Collision-contacts.html