Expression VS And

I’ve found out that an expression and and controller are different. why is this? here’s an example of what I’m talking about



The logic is for a zoom for a gun on the camera…assume “CurrentGun” is always 1
The connected one works, but the expression one, if connected will not…why is this and how do I fix it?

CurrentGun is a property name?

Wouldn’t it be better (and easier to understand) to use an property sensor that you connect to the AND as well?

yeah, “CurrentGun” is a property int (integer)
Well, I’ll have way more logic bricks later on, and even with states I want something compact.
So why doesn’t the espression work?

The logic as presented in the above screen shot makes no sense as the controller is not connected to any actuator. This means you can’t tell if it works or not.

I just did a little test and yes it works you can check a property value. Be aware similar to Python you need to check the sensors as well. Otherwise the controller will not deactivate the actuators (if there are any ;)).

This sounds like a strange argument to avoid a solution.
It sounds more like a design problem. Could it be that your object does a bit to much? Maybe you should think about using one or two other objects to do some of the operations you are aiming for.

Yeah, now that I realize it, you’re way seems more straight-forward

and I’m saying this:
Mouse - Expression - Action : DOESN’T WORK
Mouse - And - Action : DOES WORK

I’m just asking why that is

If you want to mimic the AND controller with an Expression controller you need to enter “Mouse” [if the name of the sensor is Mouse].
If you want to combine it with a property: <sensor-name> and <property-name> = <value-to-Check> (example: Mouse and prop = 1)

It is not Python. It is a mini language. You can use = and == both result in an “equal” check. you can use sensor and property names as identifier