Is there any way to get to the body of a message using just logic bricks?
It is possible to set the body using the Message actuator; yet I see no way to access the body when using the Message sensor.

I know you can get to it using python, and it is quite useful, but is there any way to get that same data using the logic bricks?

  • $\begingroup$ I've never tried it, but I suspect that, in the undocumentedness of the expression controller, there exists a method to read it. But you sound familiar with python, so why not just use that? $\endgroup$ – sdfgeoff Jun 5 '16 at 21:39
  • $\begingroup$ Accessing the body of the message is specific to python. $\endgroup$ – Anthony Forwood Jun 6 '16 at 1:15

No, there is no way.

The reason is simple: what should happen when there are two or more messages?

There are way too much options to process a body (and several bodies). The information you could get is if an message with a certain content was received. The filter by subject already does that.

I agree the API looks inconsistent, as you can set a body without any use (without using Python). I see it as simplification, when you have a lot of simple message senders, but just a few (more complex) listeners. I usually use the body when I have more information than the pure existence of a message (subject) can express.

| improve this answer | |
  • $\begingroup$ such as sending the value of a property to an object in another scene... $\endgroup$ – X-27 wants to Reinstate Monica Jun 8 '16 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.