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.
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.
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
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.