I am new to unity and i am making a clone of a a game in which i have some problem
Can any one help : -- here is my problem --I want to detect color in my 2d game by raycast, " my game is like this " :---- there are two balls uppside and downside , one of black and other of white . if player hit aby ball and if color of that ball is equal to color of player then only incriment the score other wise game is over , here is screenshot of my game :--
[1]: /storage/temp/168412-screenshot-2020-09-30-093451.png
Answer by unity_21erushbrook · Sep 30, 2020 at 01:11 PM
I'm not entirely sure what you mean, but I'd recommend just giving each ball a new script with the property: Color color; and setting that to either: color = Color.white; or color = Color.black;
Do you have any experience with C#? If not, I'd like to recommend you this tutorial: https://www.youtube.com/watch?v=9Ztd1XXmUGI
I understand its a bit lengthy but I recon it'd be worth your time following if not at least watching.
Your answer
Follow this Question
Related Questions
Layer Collision 0 Answers
How to change material color for certain time? 1 Answer
How to check for colliders when teleporting the player in a 2D game? 0 Answers
Object reference not set to an instance of an object 0 Answers
how do I let a player pass through a wall when it is the same color? 0 Answers