How can I programmatically instantiate prefabs at locations defined by a color in an image?
I'm working on an educational brick based game to help learners of Japanese better learn Kanji.
Take this character for example:
車
It will be a black font image on white or transparent background. What I would like to happen is C# "see" the black in the image, programmatically create a brick prefabs, and overlay those on top of where it sees black at certain increments.
It would be easy enough to do this manually, placing prefabs on the screen in each level. However, there are 1000s of Kanji characters and doing this manually per level would be super tedious.
I know my question may be a little unclear, so bear with me. Perhaps it may be easier to think of this way. If you were going to create a Breakout / Arkanoid level and each brick needed to sit at a position on the black, how would you approach it?
Your answer
![](https://koobas.hobune.stream/wayback/20220612063946im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Prefab script member values not correct 0 Answers
possible to ping project asset on log click ? 0 Answers
How do i move a cube by one of its Vertices/Vertex 1 Answer
localscale not working 1 Answer
Unity Dropdown Menu Not Closing 1 Answer