[Not a bug] Curious OR condition bug

There is a bug with the OR condition.

  • The event’s condition is an OR with a boolean and a object’s physics velocity checks as conditions.
  • The event’s action is to get the object’s X position.

If only the boolean condition is true, then the object’s position is returned incorrectly as 0. Otherwise it’s correct.

The object has Physics 2 behaviour. It’s kinematic, but the same issue occurs if it’s dynamic with gravity scale 0.


Here’s the scene editor object position:

image


Here are the events :


Here is a screen snip of none of the conditions being met :

image


Here is a screen snip of the boolean condition being met (space bar was pressed). Spot the incorrect Player.X() value :

image


Here is a screen snip of the velocity condition being met (left shift was pressed) :

image


Here’s a screen snip of both conditions being met :

image

Here’s a link to my test project.

I think i recall 4ian saying this is intended.

That is because of object picking: since the condition for the velocity of the player is not met, the object is unpicked, and since there is no object to run the expression on left, the default value of 0 is used.
To fix this, I think you can use an “and” condition to do the pick all objects condition on the player if SomeBool is true.

1 Like

Thanks for the explanation, @arthuro555. I have a workaround in place where each condition is in a separate event, but because it’s not the most efficient way I’ll try out your suggestion.

1 Like