[SOLVED] "OR" & "AND" operators not working as expected

Hey there,

I faced this issue multiple times with different setups while using “And” inside an “Or” condition.

I created a simplified version (attached events) that replicates the issue / possible bug.

Expected result:

  • if var = 0 and animation = 0 → the object moves
  • if var =/ 0 → the object should move (regardless of animation)

Actual result: the object doesn’t move if var =/ 0

If it’s not a bug, I appreciate if someone can tell me what’s wrong with this setup of the “Or” & “And” conditions.

If I remember correctly, object selection happens so long as there is an object related condition in an event box, being or/and doesn’t matter. So what is happening is that you have no objects that meet the “animation number” condition, so the object list is empty.

Meaning that even though the first condition is true, the actions have no objects to apply to.

1 Like

Thank you @Silver-Streak for your answer!

You’re right about object selection, but it still matters that the conditions are in the “or”.

I still believe that this should be addressed (as the below screenshot). Unless I’m wrong since I’m not a programmer myself.

I think it’s a bug. In this test both objects should spin no matter what the slider’s value is. The object is always visible. But when the slider is 0 only the anchor spins. When it’s not 0 they both spin. I don’t think it’s even testing the 2nd condition because it’s inside an and and the 1st condition is false. It shouldn’t test any other conditions unlike an or which tests them all.

1 Like

From what I can see, All of these scenarios still match my original statement.

Object selection happens regardless if it is in different parts of the or/and statements. So having a “valid” object statement in “or part 1” will give a valid action object list even if “or/and part 2” would negate it.

So, if I understand correctly, as long as there’s a condition for an object in any part of “or”, there should be (any valid) condition for this object in every other part for it to be selected?

WASD to walk around
S sets animation 1 which is idle down
Use that shaped trees to block player which is on the left since camera centers on him

If you move top and left player from left player then they will start to spin automatically

And if you move them right from that left player they will only spin is last direction you faced is down and not move (press S)

I would say it works pretty fine

@ZeroX4 In both parts of “or” (with / without &) the player is referenced in the conditions so it works.

The problem is when the object is only referenced in one part of the “or” and not the other. (1st screenshot I shared)

More so that you need to think of object selection as if there were no other conditions there. If the object conditions would lead to an object never getting selected, the object list will be empty.

If even one object would remain in the list, then that one will be selected even if it wouldn’t be taken into account by the or condition.

I think I understand now. As the screenshot below, the object is only picked when the animation = 0 and as if the other conditions don’t exist?

Correct, exactly right.

1 Like

Thank you for taking the time to answer all my questions and clarifying this with quick responses. Much appreciated!

1 Like