I have a “Miner” that you will be able to place down. Under the miner there will be around 5000 separate pixels (resource pixels/ground pixels) I would like to detect only the resource pixels.
I would like each miner to have there independent number. However when I place two or more they have the same number
The blue is the resource that the red collision box is checking. the blue are the resources. the problem is when I put down to miners they share the same number. I’ve tried links but I’ve never truly understood how they work.
This is the code I’ve been using and messing around with
I was checking the collision I wanted to have the resource count for the miner of where it is placed. So I have been using the red collision box to kinda ray-cast below it.
I made this so that the problem would be more obvious. The resources for the individual miners are not independent of each other but instead add to each other. The red hit-box is detecting a procedural generated resource (blue pixels) they are made of 4x4 pixels.
Thank you this works perfectly. I was so bent on using collision through another object that I didn’t even think about using detection through position.