Hello!
Who knows how to get properties from another object when the sensor “ray” is active?
In the process of producing my little game, I was faced with the inconvenience - many logical bricks and not universality. For example, near each button there is a lamp and a plane with a glow, and to them one must constantly attach logical bricks … And so, put the lamp near the button, the script took from the button properties - everything would be easier. And a lot of light sources in the game scene, even in the off state (energy - 0), take their resources. And so to set the movement of one lamp to different objects, and there the script will take the necessary properties. I’m just trying to optimize everything on the example of my game, then I will share a lesson.
Thank you for attention.
With the help of Nicholas_A, the issue is resolved.
Here is a working example with optimization - to change the color of the object, there is no need for animation, or/and unnecessary logical bricks. - example first by reference “WS” - movement
And the example for which the question was asked - example second by reference
==================