Identical code not working?



Your username: tankt2016

What kind of device are you using?: iPad 6th gen, with the latest version of Hopscotch

1 sentence description of the problem (I was doing _________, and then __________ happened): I was coding. A few objects had to have the same code, so I just copy/pasted. But the copy/pasted code in one object didn’t work, but it did in the other objects.

Steps to make the problem happen:

  1. Copy/paste something
  2. It doesn’t work

I expected this to happen: Obviously I expected the code to run smoothly.

But instead this happened: But the code didn’t work at all.

Here’s a sweet screenshot: Not possible.

This isn’t the first time my code hasn’t worked…


What does the code look like or what is the code supposed to do?


It’s supposed to turn invisible when the Hide Options button is tapped in this wip.
When the Hide button is tapped, it uses a value to make the options invisible, and the decorations (those objects with the code) will not turn invisible if their X position is not 950.
It’s the one with the three stars that won’t go invisible when not moved from X 950.

Year Of Code — tankt2016’s second GT Kittenz for life/ Tankt rocks/ Tankt papers/ Tankt scissors!. Tankt is the best -JACG and CoM and Apricity / Tankt is many cools -Fuwa / Tankts pretty cool -Tv

Hmmm that is really weird. The only thing that might be causing it could be that “Start=1 >visi” could be forcing it to stay visible for some reason. But like you said, they all have the same code so maybe that wouldn’t make sense either. Here’s that block I’m talking about:

Is there any chance that this start= 1 block is repeatedly trying to force them to turn visible when at the same time they are all trying to turn invisible?
It’s a really cool project though, i hope it’s possible to fix this weird bug


It might be forcing it to be visible/invisible at the same time, but the other objects had that block too and they worked fine…


Maybe it is timed just right so that the first 2 seem to be doing the right thing while the last one is just off where it’s always visible. Is all it’s code in the exact same order as the first 2? It’s kinda a stretch but it could be it


Yep, unless the order of the rules counts.


Yes, they do count.
If you move the invisibility rule to the very bottom, it will go slightly after the rule which makes it visible, which will cause it to be invisible instead of visible.


Hm odd maybe that’s it.


Yeah probably.
Try changing that and if it still doesn’t work then maybe you could try rewriting the same code or something again


It’ll work, I tested it.




Oh that did work, thanks @MyPizza, @A_Metalhead, @Petrichor!


I didn’t do anything but okay, you’re welcome


Yay! I’m excited to see the finished project! Hope you get featured for it


Maybe by rare chance the project thinks that the self variable is still referring to the other original object you copied from? Try rewriting the code manually and see what happens.



Oh wait never mind you guys already fixed it.


I agree! Good luck with the project @tankt2016!