Technically Match 3 but not really
Hello, I am extremely new to Unity and coding. I've stitched together bits and parts of different tutorials so far and it's worked well on the very basic stuff I've done so far, but now I hit a speed bump.
In that link you will see the very simple gist of the game idea which is to press on a square which is part of a group of at least 2 to destroy them. The question I have is what technique, method, functions, or what have you should be used to identify on click of any square, the number of the connected squares in the group to make them all go away with that 1 click ? Could it be raycasting from the original square in a cross shape that stops in any given direction if it hits outer border or a different color or keeps going and creates new star shape raycasting when it hits same color as original clicked square's color, or something completely different that I am unaware of ? Basically I just need to know what is my next step to start googling and having a gander at.
Never tried anything like this before, but you could use colliders on both objects, and tag them by colour, you could use OnCollision functions like this
void OnCollisionEnter (Collider other)
{
canDestroy = true;
}
void OnCollisionExit (Collider other)
{
canDestroy = false;
}
Good luck with your googling :)
i don't think tags would be needed as every tile has its own index / value of what color it represents, if i get where i want to be i would just have to cal on that function again.
Your answer
Follow this Question
Related Questions
List.FindIndex 1 Answer
Method Group 1 Answer
Load Scene Unity by Application.LoadLevelAsync 0 Answers
OnTriggerEnter not working 2 Answers