Discuss Scratch

Demonic_maker
Scratcher
1 post

Touchig color detection not working correctly

My browser / operating system: Android Linux 10, Chrome 138.0.0.0, No Flash version detected. I've been working on a project where a sprite should detect when the sprite is clearly touching the color the touching color ? Block returns false. I tried everything for one day - changing layers, re-creating sprites and checking the exact color - but it still happens. Can someone help or confirm if this is a bug?
tiaza
Scratcher
500+ posts

Touchig color detection not working correctly

Maybe a link to your game would be helpful since you've tried the basic bug-checks. I haven't heard about a Bug like this, so I assume that there might be a Bug in your Code or something. Does it happen in the offline Editor too?
d016
Scratcher
100+ posts

Touchig color detection not working correctly

You probably have a sprite above the color(s) that you want to detect:
Here's a demo of that happening: https://scratch.mit.edu/projects/1236779949/

If you don't want to use the demo, then know that a
<touching color [#1b37da] ?>
Doesn't check for only the colors behind the sprite, other sprites' colors in front of the original sprite will take priority.
In short, only the front-most colors are detected.

Last edited by d016 (Nov. 1, 2025 22:50:11)

Powered by DjangoBB