Discuss Scratch

ColtPanther2016
New Scratcher
1 post

how do you make a sprite follow your mouse?

how do you make a sprite follow your mouse? help?!
21lyoja
Scratcher
100+ posts

how do you make a sprite follow your mouse?

foreverpointtowardsmouse-pointermove4steps
drmcw
Scratcher
1000+ posts

how do you make a sprite follow your mouse?

Be careful with the
pointtowardsmouse-pointer
block as It currently has a bug and doesn't work when just dragged into a project. To fix; just re-select mouse-pointer from the block's drop down menu.
Thiplol
Scratcher
100+ posts

how do you make a sprite follow your mouse?

forevergotomouse
jacquesimo
Scratcher
100+ posts

how do you make a sprite follow your mouse?

whenclickedforevergotomouse pointer

Or

whenclickedforeverpointtowardsmouse pointermove5stepsSpeed replaces 5

p.s. Don't forget this!

whenclickedgotox:0y:0
Jagged-tail
Scratcher
8 posts

how do you make a sprite follow your mouse?

21lyoja wrote:

foreverpointtowardsmouse-pointermove4steps
That points, not goes to.
this should help:
whenclickedforevergotoMouspointer
asivi
Scratcher
1000+ posts

how do you make a sprite follow your mouse?

Jagged-tail wrote:

21lyoja wrote:

foreverpointtowardsmouse-pointermove4steps
That points, not goes to.
this should help:
whenclickedforevergotoMouspointer
Please read the original post

ColtPanther2016 wrote:

how do you make a sprite follow your mouse? help?!
-Spectrum
Scratcher
500+ posts

how do you make a sprite follow your mouse?

ColtPanther2016 wrote:

how do you make a sprite follow your mouse? help?!
To make a sprite follow your mouse forever, all you need is a very simple script:

whenclickedforevergotomouse pointer

The sprite will act as if it is stuck to your mouse. If you use this script, which many people have been suggesting . . .

whenclickedforeverpointtowardsmouse pointer

. . . then it won't actually work, at least not for what I think you're trying to do.
You could also replace the ‘go to mouse pointer’ block with this, although there's no point really:

gotox:mousexy:mousey

I hope that helps, this topic has been getting a little confusing with all the answers!

drmcw
Scratcher
1000+ posts

how do you make a sprite follow your mouse?

-Spectrum wrote:

If you use this script, which many people have been suggesting . . .

whenclickedforeverpointtowardsmouse pointer

. . . then it won't actually work, at least not for what I think you're trying to do.
That's why each person who suggested it has added a move block to the loop so it will work. You just need to be careful of the scratch bug associated with that block and just re-select mouse-pointer from the blocks menu to fix.
Ph0enix3000
Scratcher
94 posts

how do you make a sprite follow your mouse?

whenclickedforevergotomouse pointer

or

whenclickedforeverpointtowardsmouse pointermove10steps
moss-shadow
Scratcher
500+ posts

how do you make a sprite follow your mouse?

Here's a harder but cooler way:
whenclickedforeverwait.1secssetxtomousexsetytomouseywhenclickedforeverglide.1secstox:Xy:Y
harryhorseharp
Scratcher
10 posts

how do you make a sprite follow your mouse?

whenclickedforevergoto mouse pointer

Powered by DjangoBB