Need to make the both of the light work as a line of sight
I am making this casual game which is going to use gyroscopic controls to control a ball which has 2 point lights attached to it. I have to make one of the mechanics work properly which is that there are two types of boxes the player can collect. As you can see below two point lights 'Purple' and 'Blue' is there and there are two colored objects too.
So the gameplay is the purple boxes will be only visible if the purple light is on it and vice versa for the blue boxes.
The player can only collect the blue/purple boxes if they visible within the light.
Since I am really new to unity, can anyone tell me what do I need to make this mechanic work?
simply put a sphere collider set as trigger onto the lights, mimicking their light radius. on trigger enter show the boxes that match a tag or name or whatever tells you that it's the right trigger that was entered. hide them when exiting
can you tell me how the script should be written? I'm sorry I'm really not good at scripting at all. I just started learning unity. It would be really helpful. Thank you anyway :)
Your answer
Follow this Question
Related Questions
Changing the direction of movement 0 Answers
Character "moving back" 0 Answers
Disable movement button, C# 1 Answer
Object moves through the position of another object 0 Answers
How to make player move along x axis? 0 Answers