Discuss Scratch

Meowmeowmeowmewow
New to Scratch
1 post

Hey i need help with the my blocks function

Basically i have a if variable with an “if touching Object1 or touching Object2 or touching obj..” etc etc, and i wanna shorten all of that with one single my block function, but i don't know how, when i do;

Define my block <My block>
My block : “ touching Object1 or touching Object2 or touching obj..” etc etc, it just doesn't work.

Thanks in advance
deck26
Scratcher
1000+ posts

Hey i need help with the my blocks function

Best if you share your attempt at doing this.
-TUB-
Scratcher
100+ posts

Hey i need help with the my blocks function

Unfortunately, Scratch does not support return values from functions, but you can use a variable instead:

define check collisions
set [touching v] to (0)
if <<<touching [object 1 v]> or <touching [object 2 v]>> or <...>> then
set [touching v] to (1)
end

- T U B -
The United Bathtubs


Select part of my signature and use shift+down arrow to see the rest





Powered by DjangoBB