Variables help

Aug 02, 2023

I've simplified my problem to one box and two ovals.

You can see it here.

When you place either oval in the box, the variable BoxOccupied changes to true.

However, when you place both ovals in the box and remove only one, the variable changes to false even though the other oval still occupies the box. How can I change this behaviour to keep the variable true whenever the box is occupied?

Am I missing something obvious? I'd love to hear your solutions.

3 Replies
Louise Lindop

Hi Mark. It's going to set it to False whenever you remove either Oval because that is what your triggers are telling it to do. I'm not sure what your actual objective is, but I would either use two different variables or a number variable instead. There are a bunch of different ways to do it, but I've modified and used a counter variable and attached. 

Mark Fensom

Hi Louise, thanks for this.

I need the BoxOccupied variable to control something else when it's true. I can use the number variable zero as false and any number greater than zero as true.

This is a more straightforward solution than what I had planned.

I'll test this out on my main project.

Thanks again.