- Home /
Colour Detection System
Hey all! I did some searching and found nothing but basically I am wondering if there is anyway to make an action happen if a certain colour is detected?
For example, a camera facing a blank wall, and if a green coloured object appears it prints "Green". If a blue object shows it prints "Blue"?
Another wording would it can recognise different colours. I know this is coming close to artificial intelligence but is there anyway to code it easily, if not just say :) thank you!
Answer by Eric5h5 · Aug 05, 2012 at 01:00 AM
The simplest way would be to make tags for different colors, and apply the appropriate tags to various objects. Then use raycasting, and check the tag of any object the raycast hits.
Answer by diegzumillo · Aug 05, 2012 at 01:32 AM
You could identify the colors with the materials assigned. A simple trace from the camera in the viewing direction would hit the object and you can easily find out (material name, maybe, but a tag would be better) if it's "red" or "blue".
A limited strategy, as every model would have only one color. But, depending on the project, it could be sufficient.
Your answer
Follow this Question
Related Questions
Material doesn't have a color property '_Color' 4 Answers
Changing two different objects renderer colour 1 Answer
How to detect the color of an object?,How to detect the color of the objects. 0 Answers
Change Color For One Line? 1 Answer
Font Color changing shader [color changes based on what background color is] 1 Answer