trying to have two sensors needed to change a property (AND)

I’m trying to have a sesnsor for object A (mouseover or key for now) send a message to object C. Then, at a later time, have a sensor for object B send a message to object C. Then, if, and ONLY if object C has received both messages, it will change a property. I have tried setting and “AND” controller, but it doesn’t work. It seems that the second message maybe is cancelling the first (?) or that the object C is ‘forgetting’ that it has received one message, and needs the second to invoke the actuator. I don’t know anything about Python, but it seems that this should be possible with logic bricks. Any help would be welcomed and appreciated.

You are misunderstanding how sensors work. Sensor check their state every “logic tic.” By default, there are 60 logic tics in a second (you can change this, but that’s a rather advanced thing to be messing with).

When you send the message from Object A, it is received by Object C on the very next logic tic. The message sensor immediately fires one positive pulse (TRUE) to the controller and then stops. It will not send another pulse unless it receives the message again.

Object B sends its message at some later time. Object C receives it, and its message sensor fires a positive pulse (TRUE). Again, it will not fire another positive pulse unless it receives the message again.

The AND controller is looking for both message sensors to be TRUE at the same time, but based on your explanation, this will never happen, since the messages are sent at different times.

There are several ways to do what you are wanting to. Python would be the simplest, but you’ve said you don’t know anything about it. To do it with logic brick might look something like the attached image:

Attachments


Actually after I posted this question, I had figured out to use messages to change a property to “true”, which will stay “true” (unless it’s changed again) and then use the property and the second sensor with and “and” controller. As you said, messages are only one tic, but the property stays the same to be checked every tic. I got it working, but I do thank you for the thorough explanation and the layout image!