How do I send the property value to a message?

I was playing in my game when I thought of making custom controls, but for that I tried to use one of the scenes in my game to send commands.

I would like when the key is pressed the message of Object 1 sends a message to all the objects, sending the value of property KeyW, and if the message received by object 2 is 1 it will move.

anyone know how I can do to send the value of the property by a measurer type actuator?

I want it to work as follows, when I press the W key it sends a message with the same value as the KeyW property, I can not easily create a keyboard type sensor and another type property, for 2 reasons it will take me a lot of time and the game will get very heavy.

Without using Python good luck.

But one way could be to send your message each frame that the key is pressed, and when the key is released, stop sending the message. I think you can do that with pulse mode on the sensor.

edit: I see that you don’t specify a subject when you send the message, you should.

Then you use your message sensor representing the “forward” action to act as if it were directly the keyboard sensor.

Not sure if that would work.

1 Like

I was trying to pass a message with the same property value, it works the next time, the number that is there is the button’s key.

for example:

1 = backward movement
2 = forward movement
3 = interaction

theres lots of keybind resources. no need to keep reinventing the wheel.

1 Like

I do not understand very well, can you explain me?