Change the color of an object on a secondary layer

I have an object that is created on two different layers. I would like that when a key is pressed, the object changes color only on one of the 2 layers

Just check the layer

Just add a condition that checks if the object is on the specific layer you want.

Something like this:

  • ‘S’ key pressed
  • ‘myObject’ is on layer ‘this layer’
    • Change colour of ‘myObject’ to ‘red’

thank you very much i solved it