When Is Not Touching

For people without the HS subscription, they can have trouble making the coding for when is not touching. While with the subscription, there is a block for that. So today, I will show you how you can make when is not touching without needing the subscription.

So in this example, this is how it will work:
If Star Girl is touching the red and green circle, nothing happens. When she is missing one or both of the circles, she will shrink.

As of this example, this only a one time use, so when you drag the circles back to star girl, she will not stop shrinking. To prevent this, you will have to reset the variable.



How it works: When the green circle is touching, it adds the variable by 1. When the red is touching, it subtracts the variable by 1. So the variable will be 0. When a circle is missing, the numbers will unbalance and not be 0 anymore. Star Girl will then start to shrink.

12 Likes

Btw, you don’t need to do the not touching system recheck part of the code.
It was just a test I did.

6 Likes

O ok I will try

7 Likes

I don’t know but I think Thinbuffalo made something about this

6 Likes

but if it unbalances too much, like 3092, it’ll take 3092 frames to get back to 0, which is really long

i’d recommend to use this instead of “increase by”:

When Star Girl is touching Object 1
Set Var To min(Var+1;1)

When Star Girl is touching Object 2
Set Var To max(Var-1;-1)
11 Likes

Thanks! This is is very helpful!

4 Likes