Question about OR

So i am trying to make the following statement work:
if (!mousePressed or (!cursor.Collide(mocc) and !cursor.Collide(TargetRoundButton)){
//action
}
as follows:

But this condition seems to be misbehaving, probally because i did something wrong. Because each individually action works just fine, but both combined inside an OR dont work, it seems only one is checked. It seems the and condition overruns the or in any scenario i try.

How do i make this corectly?

That’s just saying all 3 condition parts need to be satisfied, the extra parentheses are unnecessary as there’s no OR in this condition.

Or did you mean (pun intended :slight_smile:) :
if (!mousePressed or (!cursor.Collide(mocc) and !cursor.Collide(TargetRoundButton))?

Whops, i did wrote that wrong. Its an OR there. Just one of those two

I’d be curious to know what you find out. I’ve used OR successfully, but if one of the conditions under OR is AND (like you have in your example), then I’ve not been able to get it to work.

Well, i simply created another event, separating the both and it worked. But it seems to be a bug in the gdevelop?

Should i report this bug or something?

What are your actions? Also, keep in mind that even if the cursor is in collision with a mocc or a TargetRoundButton, if there is any other instance that is not colliding it will still trigger.

The action is a “set animation to the first animation”
Having a sole action only for the negated mouse button down and one for the cursor collision works as intended. But those together there dont seems to work

That it is an animation change I could see in the screenshot, what object has it’s animation changed?

While this wont fix your problem, as a general reminder whenever you are changing your animations you always want the trigger once condition in your event, otherwise your animation will be reset every frame.

you cannot combine object related conditions with conditions that are not object related.
so you need to split up your OR into 2 events, 1 for mouse action, the other for cursor sprite action.

There is a little bit more to it than that, and you can combine condition types and or, just not for object selection. There’s some workarounds too, which can be read here: Why doesn't this work? (Animation won't change in this OR event) - #9 by Gruk

I’m wondering if adding the pick all condition would help here, like in my testing in the above linked post.