Need help with “when it’s touching”

So I’m trying to make a thing but I need something to set a variable to something when it’s touching something and to change the variable when it’s not and idk how to do this

6 Likes

I have wondered the exact same thing.


This should work😀

3 Likes

I tried something like that but it doesn’t work. The variable can’t change it needs to stay the same while it’s touching something.

3 Likes

Maybe you could use a check once if block?

When it’s touching the object, set variable to “this”

Repeat forever
Check once if variable=this
Repeat (however many times)
Set variable to “this”

2 Likes

i got it. I don’t remember how but it uses like ten variables

2 Likes

Yipes. Can you post it please? I need the code.

1 Like

https://c.gethopscotch.com/p/za652hwoi

Here. There a slight delay but it’s as fas as I could make it

2 Likes

Nice nice nice I nominate it for featured!!!

1 Like

That’s the code I gave you?!

No I used the idea of the code U gave me but I changed it because the code you gave doesn’t work for what I need

1 Like

My code

!

Your code

Not all the code is in the text

It’s the same?! @parttimefemaIe


Your right it’s slightly different nice job! You should make a game with this!

I am that’s why I asked how to do it

1 Like

What game? @PartTimeFemaIle

It’s an rpg. Working on the demo. Probably be out by monday

1 Like

I see that you got it working, and that’s great! I am excited for the game that you are talking about!

1 Like