Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how do i make a fast projectile stop right when it hits a wall, instead of passing it before it's supposed to stop itself
- -TheOrange-
-
Scratcher
83 posts
how do i make a fast projectile stop right when it hits a wall, instead of passing it before it's supposed to stop itself
im not making the projectile slower, i kinda need it to be fast lol
an example project in my profile, just focus on the “projectiles” sprite
an example project in my profile, just focus on the “projectiles” sprite
- Incognito-Cat
-
Scratcher
100+ posts
how do i make a fast projectile stop right when it hits a wall, instead of passing it before it's supposed to stop itself
You could try doing
when green flag clicked
forever
if <touching [wall sprite or whatever it is v] ?> then
hide
end
end
Last edited by Incognito-Cat (April 6, 2023 22:32:16)
- -TheOrange-
-
Scratcher
83 posts
how do i make a fast projectile stop right when it hits a wall, instead of passing it before it's supposed to stop itself
You could try doingit basically already does this, added this script didn't change anything either.when green flag clicked
forever
if <touching [wall sprite or whatever it is v] ?> then
hide
end
end
- medians
-
Scratcher
1000+ posts
how do i make a fast projectile stop right when it hits a wall, instead of passing it before it's supposed to stop itself
You could try doingThey're using clones:when green flag clicked
forever
if <touching [wall sprite or whatever it is v] ?> then
hide
end
end

The sprites not creating the clones or having clone scripts are “the walls” and “body”.
Also, why do you have a go to front and back block at the same time in the body script:

Last edited by medians (April 6, 2023 22:42:26)
- PangolinTests
-
New Scratcher
1 post
how do i make a fast projectile stop right when it hits a wall, instead of passing it before it's supposed to stop itself
The Best way to do it is this, with a custom block (Custom block has run without screen refresh)
define Move (Steps) Steps
repeat (Steps)
move (1) steps
if <touching [wall] ?> then
delete this clone
end
- -TheOrange-
-
Scratcher
83 posts
how do i make a fast projectile stop right when it hits a wall, instead of passing it before it's supposed to stop itself
I wanted to make the weapon over both the body and head but I changed it to be separate and the weapon being with the head, I guess I forgot it thereYou could try doingThey're using clones:when green flag clicked
forever
if <touching [wall sprite or whatever it is v] ?> then
hide
end
end
The sprites not creating the clones or having clone scripts are “the walls” and “body”.
Also, why do you have a go to front and back block at the same time in the body script:
- -TheOrange-
-
Scratcher
83 posts
how do i make a fast projectile stop right when it hits a wall, instead of passing it before it's supposed to stop itself
The Best way to do it is this, with a custom block (Custom block has run without screen refresh)could you remix the project and insert this, this is my first time messing with custom blocks apparently, I don't know what I'm doingdefine Move (Steps) Stepsrepeat (Steps)
move (1) steps
if <touching [wall] ?> then
delete this clone
end
Last edited by -TheOrange- (April 7, 2023 03:33:44)
- Discussion Forums
- » Help with Scripts
-
» how do i make a fast projectile stop right when it hits a wall, instead of passing it before it's supposed to stop itself



