Discuss Scratch

ChickenYumSoup
Scratcher
70 posts

The sensing block isnt working in my games :(

For me the sensing blocks like
<touching color [#d938dd] ?>
and
<touching [ v] ?>
and stuff dont work in my games
I need help how do i fix dis ?
_DatsDabunny_7
Scratcher
15 posts

The sensing block isnt working in my games :(

Could you please share the project then give the link?
It helps when we can see what the problem is. If you don't want to share the project just yet, then use the blocks to show exactly what the code in the project isn't working.
ChickenYumSoup
Scratcher
70 posts

The sensing block isnt working in my games :(

ok here is the link for the sensing test, i wanted it so if the sprite was touching the cursor it would glide somewhere.
https://scratch.mit.edu/projects/763141532/ i Desperately really want to know how to fix it.
its just a test that i made now because i dont really use sensing blocks

Last edited by ChickenYumSoup (Nov. 17, 2022 06:49:16)

PutneyCat
Scratcher
500+ posts

The sensing block isnt working in my games :(

The problem is that your code just does does a single check (to see if the sprite is touching the mouse-pointer) as soon as the green flag is clicked. And that's it - the code stops there, and doesn't check again.

Rather than just checking once, you want to keep checking. If you wrap the “if…” bit in a “forever” loop it will work more as you expected.

Winnersscratch200
Scratcher
46 posts

The sensing block isnt working in my games :(

Try this:
If you want it to repeat only once then do this:
When gf clicked
wait until <touching (mouse-pointer v)>
if <touching (mouse-pointer v)> then
do something :: grey

But if is forever do this:
When gf clicked
forever
if <touching (mouse-pointer v)> then
do something :: grey
I hope this helped.
Please give feedback if it worked
PurpleSuit
Scratcher
500+ posts

The sensing block isnt working in my games :(

Id reccomend using sensing touch blocks and not color, but…
when green flag clicked
forever
if <touching color [#a7a154] ?> then
do something
end
end
ChickenYumSoup
Scratcher
70 posts

The sensing block isnt working in my games :(

thanks all
it really helped!
im gonna make a platformer using this info!
tysm.

ChickenYumSoup
Scratcher
70 posts

The sensing block isnt working in my games :(

and im transforming the sensing test into the platformer lol
TheVeryCool
Scratcher
15 posts

The sensing block isnt working in my games :(


still not working....

Last edited by TheVeryCool (July 18, 2024 12:37:15)

Powered by DjangoBB