I am trying to step though some basic AI logic and I would like to have a ‘sensor’ object send a message to another specific object. I am for now limited to using logic bricks, but if this proves impossible I would be happy exploring a py solution, although I want to keep things (for now) as simple as possible.
What I am running into however, is some conflicting information on how the ‘message’ actuator works. In the game logic documentation (http://download.blender.org/documentation/NaN_docs/BlenderGameReference/actuators.html) it states that the ‘To:’ refers to objects with a specific property. The popup help, however, specifies that it is for sending messages to objects with the ‘name’ in the ‘To:’ field.
What make things more confusing is that neither appears to work. Am I just setting things up wrong, or is this actuator not functioning as designed?
Message Sensors and Actuators are really useful to “pass data” between
In the same scene you can select different objects and link them “directly”.
Anyway here’s a way to make them work:
Sensor (ex:collision) -> AND -> Message Actuator - Subject: foo
Message Sensor - subject: foo -> AND -> Motion Actuator - Drot: 0, 0, 1
The message actuator uses the complete object name in the “To:” field. That means it must be preceded by “OB” e.g. OBCube.
If there is no entry in that field the message is passed to all objects.
The field “Subject:” can be used to filter messages within an message sensor.
The field “Body:” can have any text or the value of a property. You can toggle between text and property mode by pressing the T/P button.
That’s exactly what I was looking for, Monster, thank you!
Where is the complete object name stored, or are all objects preceded by ‘OB’?