Discuss Scratch

presentgames
Scratcher
3 posts

follow script

hello scratch! i came here to report a bug that`s really been BUGGING me every time i try to make a sprite follow another it always goes the opposite direction

_nix
Scratcher
1000+ posts

follow script

What's your script?

Making a sprite follow another sprite is pretty simple:

when green flag clicked
forever
point towards [target v]
if <(distance to [target v]) > (10)> then
move (10) steps
else
go to [target v]
end
end

It could be that your sprite is facing in the wrong direction, because of its costume. Take a look at this:



In the costume editor, right means forwards. You can see that in this simple demo:


forever
point towards [mouse-pointer v]
end

It might be that your sprite was drawn so that its face is on the left, which would look like this:



But note that the sprite is still following the mouse (its target), not going away from it. I think something would have to be wrong in your script for the sprite to be moving away from whatever it's following.
presentgames
Scratcher
3 posts

follow script

thanks!!!! nix
_nix
Scratcher
1000+ posts

follow script

presentgames wrote:

thanks!!!! nix
No problem, glad I could help.
francisco418
Scratcher
24 posts

follow script

Its pretty easy:
when green flag clicked
forever
point towards [target]
move (How much you want) steps
end

Last edited by francisco418 (June 11, 2020 02:42:25)

-gr
Scratcher
1000+ posts

follow script

francisco418 wrote:

Its pretty easy:
when green flag clicked
forever
point towards [target]
move (How much you want) steps
end
Please don't Necropost.

Last edited by -gr (Sept. 22, 2021 21:30:41)

1492864
Scratcher
500+ posts

follow script

-gr wrote:

francisco418 wrote:

-snip-
Please don't Necropost.
How Ocular? and why did you find this?
cool_dog2902
Scratcher
2 posts

follow script

this is so EZPZ
Tunde123
Scratcher
1000+ posts

follow script

cool_dog2902 wrote:

this is so EZPZ
Please do not necropost.

Powered by DjangoBB