- Home /
The question is answered, right answer was accepted
How to make game like Hoops Stack
,How to Make Detection if all color are in their place like hoops Stack game I made the game , but i only the color match is the problem when all hoops are in place i need how to detect that they are all correct
Blue with blue hoops Red with Red hoops Green with green hoops
like the game Hoops stack , for refrence :
https://www.youtube.com/watch?v=_UA7mhOILNY!
,i put 3 Pipes , they ae available for all colors, but i want when all colors each are together :
Blue with blue in 1 Pipe Red with Red in 1 Pipe Green with Green in 1 Pipe
how to detect the correct tag , i tried lot of script but did not work for me !
as a reference of game type i make game like Hoops Stack! https://www.youtube.com/watch?v=_UA7mhOILNY
hello did you find any solution about this?basically i am also working on this kind of game(i am working on ball sort game).so if you have any idea then can you please tell me something about it.,hello did you find any solution about this? i am also working on this kind of project(ball sort game). so if you have any idea about this then can you please tell me.
Answer by Llama_w_2Ls · Jan 29, 2021 at 01:05 PM
@Nameless777 Since the poster possibly moved on, I'll just post a solution here for you.
One way to do this, is to use lists of objects, that contain info about their colour and position. For example:
public class Hoop
{
// color
public Color color;
// which pole is it on
public int HoopNumber;
}
Then, in your win check, you take each of the three lists, and check through each of the Hoop objects in the list. If all the hoops have the same color, you win.
You can also do the same with tags. For example, a list of game objects with tags containing their color.
Follow this Question
Related Questions
OnTriggerEnterProblem 1 Answer
Using the OnTriggerEnter ∁aring tags correctly. 1 Answer
AI Attack Not Working! W/Video 1 Answer