Text objects created by cloning don't always respond to touch

What kind of device are you using?:
iPad Pro (4th gen) (HS says "“iPad8,11”)
iOS 14.5.1
HS version 3.46.6
Player version: 1.5.14
1 sentence description of the problem (I was doing _________, and then __________ happened):
I was creating clones of text objects, all of which are supposed to respond to touch events, and then only some of them actually did
Steps that the Hopscotch team can take to reproduce my problem every time:
I’ve published a project that demonstrates the bug for me: 11ofbwwabc
I expected this to happen:
All the numbers on the right should respond to Bear the same way, by spinning, and setting the “Bear last touched” value.
But instead this happened:
When I play this project on my iPad, the bear is not able to make 2, 3, 5, or 7 spin (those objects don’t respond to touch events), but the other numbers work fine. However, within the web player, it all works fine.

Is anyone else able to (within HS, on an iOS device) reproduce this behavior?

12 Likes

that’s very strange

6 Likes

So, did you see the same behavior when playing it on an iPad?

(to find it within HS “Explore”, I had to search for RacingCarrot9000, my previous nickname; searches of Projects for “why can’t bear touch”, or for Hopscotchers “anisotr0py” didn’t work; I’m not sure why)

6 Likes

yep

what happens if you don’t set the width/height before setting the size?

3 Likes

When I remove the “Set width () height ()” block I get the same buggy behavior.

4 Likes

Strange. I checked out your project and it seems to be something with the text size. So if you have a number from 1-9 it doesn’t work, but 10 and up is completely fine. Maybe put a space in your text object?

3 Likes

If u set 2, 5, 3, or 7 to a 2 digit number it works and interacts with bear.

3 Likes

Not always. Here is a the project ID of a new test I just published: 11ofvz3oml
On my iPad, the 2 digit numbers also do not respond.
On the web, the single digit numbers don’t respond.

But if you change the “foo” text around (in the ways described on the left edge of the project), you can make even 5 digit numbers not respond, or make even the single digit numbers respond.

So there is a bug, and I think it relates to the size difference between the original object (or the player’s cached memory of the original object size?) vs the the size of the object it becomes after cloning.

Are there other known bugs about failures to detect cloned-and-the-changed objects touching things?

2 Likes

(maybe, but I need the string as a number to work with later, so I don’t want to change the string to something that doesn’t exactly represent a number)

2 Likes

they work ok to me?
I am playing on browser

1 Like

In the browser, it works for me too.
On the iPad, the bug shows up: some text objects don’t respond to touch.
Can you test on an iPad?

1 Like

Also, forgot to mention: here is a project: 11ofvz3oml
(I don’t yet have the ability to post links, sorry; it is “Why can’t bear touch some numbers?” by anisotr0py)

That project is simpler, and even in the web browser the bug is evident: the single-digit text objects do not respond to touch events. On my iPad, both the single and the two digit numbers do not respond to touch events.

I’m very curious if you see the same behavior.

1 Like

@Petrichor sorry to bug you but were you able to see the bug (in this 11ofvz3oml project you liked)- that the smaller text objects do not respond to bear’s touch?

3 Likes

Yeah. Weirdly enough, changing the text object’s text to an empty string only sometimes fixes it. I’ve done it 3 times and it only worked 2 of them. The third acted as it did before. What’s really weird is that if I change it back to “foo”, depending on how I change it it acts differently.

If I type “foo” then click the check, and ignore the auto capitalization, I get this:


If I let it capitalize itself then change it back, it works like normal.

5 Likes

Ok - thank you, thank you, thank you for confirming that you’re also experiencing the annoying nature of this bug. For the longest time I was fighting this very bug in my recently-published Eratosthenes project 11obb956oj , which relies on a spatial layout of text objects, and their touch interactions with another object to change their state. Once the bug showed up (some numbers didn’t interact via touching), I ended up having to recreate the project from scratch. Thankfully the bug hasn’t shown up in the new project but I’m afraid…

I totally appreciate from experience the value of having a simple predictable route to reproducing a bug, but I also know that sometimes the worst (discouraging to further development/experimentation) bugs are the ones that show up unpredictably.

I’m hoping that this bug can get some more attention from people in a position to fix it. If you post a link to the project 11ofvz3oml it might help?

5 Likes

Something that I notice is that with the bigger numbers, only the first 3 digits work.


I found a way to modify the webplayer to get it to show this:


I just replaced t.ENABLED=!1 with t.ENABLED=!0. This seems to stop it from going fullscreen, but it draws this which shows some useful stuff that confirms what we’ve seen.

In chrome with the modification I see this:


However sometimes, after some time has passed and when I’m not looking, it changes to this:

which looks and works better.

The way it seems to work is if the two orange rectangles overlap, it checks if any of the blue pixels are overlapping.


While typing this my app also changed:


I think this is perfect.

5 Likes

Thanks again @Petrichor for confirming that I wasn’t going crazy. (In my Eratosthenes program this was an issue because the next prime number is detected by touching between a number and the square “cursor” that traverses the number grid. no touching = missing prime numbers = universe crumbles).

I agree that the end result (the last image you shared) looks like the correct behavior, but it’s not perfect if things are changing for you as you type, right?

For comparison here: 11ogf1jym5
is a project where all the numbers detect touching on my iPad and on the web (but on the web, the numbers are weirdly shifted to x=0). In this project the text object is only a single newline (which makes the Text object vanish in the Editor window), but otherwise the rest of the code is the same.

I think @Petrichor’s experience with “Why can’t bear touch some numbers?” and the comparison with " Where did the number-generating text object go?" confirms that there is in fact a bug in how text objects created by cloning don’t always respond to touch. What is the process for getting bugs fixed?

5 Likes

I’m curious if this is also an effect of text not drawing on the first frame.

4 Likes

Tagging @Yuanyuan with a summary of the issue and our discussion.

Text objects created by cloning do not consistently respond to being touched by other objects. The issue seems related to how large the original text object was, prior to being cloned. @Petrichor confirmed the behavior in the context of a project I made to demonstrate it:

The first image in Petrichor’s post #17 shows exactly where (where text is black instead of blue) the bear is unable to get the text to respond to touching, at least when the project first loads in the web player. With time, the numbers “1” and “3” also respond in the web player, but this is not correct behavior. Within the iOS app, none of the single- or two-digit numbers respond to touch in this project.

In contrast, in another project (made to highlight how Text objects can apparently disappear in the editor), which uses the same code for cloning text objects and responding to touch:

the bear is able to touch all the objects. Note that in this second project, the web player also exhibits a different bug: the text shows up on the left edge. This bug does not occur in the iOS app (for me at least).

why this matters to me

This bug significantly slowed development of my project demonstrating a way to find prime numbers:
Eratosthenes v1.1 (fewer bugs) by anisotr0py
The bug did not appear in a re-write of the project. Capturing the bug in a published project took significant time.

4 Likes

(oops meant to note @Nobody also helped confirm the issue; thank you; don’t have editing powers…)

3 Likes