- Home /
Adding extra Texture with a Trigger
Hello
I'm having some trouble finding what I'm looking for, even on the internet! if someone could help me with this problem that would be super! :)
One aim in my game is to turn on the power, so I'm trying to create a lighting system. all I need help with is adding an extra texture to multiple objects around the map (THE LIGHTS). Basically when the player pulls the lever I would like the emisive map to appear on the light.
I would like to use a trigger mechanism if possible so that when the lever handle reaches the end point of its animation it ends up triggering the event.
If anyone could help me out it would be greatly appreciated!!!!!
Thanks
For the triggering, you could use an animation event or an actual trigger collider. Both would probably work for what you want. As for the textures, store a texture in a field in your class (public fields can be assigned in the inspector). Also, store an array of your lights, as well as the "old" texture. When you are ready to switch all of them, iterate over the collection of lights and assign their material/texture to the appropriate field. You can reverse the process as well. Let me know if you have any questions!
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
My sand texture is strangely bright. 0 Answers
Help, problem with the light in unity 1 Answer
Why is my texture like this? 1 Answer
Arduino LDR Sensor to Play Audio Clip At A Certain Level 2 Answers