Discuss Scratch

-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
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

Incognito-Cat wrote:

You could try doing

when green flag clicked 
forever
if <touching [wall sprite or whatever it is v] ?> then
hide
end
end
it basically already does this, added this script didn't change anything either.
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

Incognito-Cat wrote:

You could try doing

when green flag clicked 
forever
if <touching [wall sprite or whatever it is v] ?> then
hide
end
end
They're using clones:

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

medians wrote:

Incognito-Cat wrote:

You could try doing

when green flag clicked 
forever
if <touching [wall sprite or whatever it is v] ?> then
hide
end
end
They're using clones:

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:
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 there
-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

PangolinTests wrote:

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
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 doing

Last edited by -TheOrange- (April 7, 2023 03:33:44)

Powered by DjangoBB