Discuss Scratch

coder9902htm4a0
Scratcher
51 posts

How do i make my character follow the cursor

I want to make my character follow my cursor how do i do it?
AonymousGuy
Scratcher
1000+ posts

How do i make my character follow the cursor

whenclickedforevergotomouse pointer
Will simulate a dragging effect.

But,
whenclickedforeverpointtowardsmouse pointermove10steps
Will make the character move towards the mouse pointer from its current position.

Hope this helps!
coder9902htm4a0
Scratcher
51 posts

How do i make my character follow the cursor

AonymousGuy wrote:

whenclickedforevergotomouse pointer
Will simulate a dragging effect.

But,
whenclickedforeverpointtowardsmouse pointermove10steps
Will make the character move towards the mouse pointer from its current position.

Hope this helps!
Never mind,i figured it out, but thanks!
platypusProductions
Scratcher
1 post

How do i make my character follow the cursor

I used AonymousGuy's script for following but the sprite spazes if it gets too close. I'd like to fix that but I don't know how! Please help.
coder9902htm4a0
Scratcher
51 posts

How do i make my character follow the cursor

platypusProductions wrote:

I used AonymousGuy's script for following but the sprite spazes if it gets too close. I'd like to fix that but I don't know how! Please help.
Well, if I understand correctly, as far as i'm concerned there's not really a workaround to that
drmcw
Scratcher
1000+ posts

How do i make my character follow the cursor

platypusProductions wrote:

I used AonymousGuy's script for following but the sprite spazes if it gets too close. I'd like to fix that but I don't know how! Please help.
foreverrepeatuntildistancetomouse pointer<10pointtowardsmouse pointermove10steps choose whatever minimum distance you want

Last edited by drmcw (Dec. 6, 2013 21:38:58)

owlpillow
Scratcher
49 posts

How do i make my character follow the cursor

by the way, if you want it on the cursor


forever loop
set x to mouse x
set y to mouse y
forever loop
Failord
Scratcher
1000+ posts

How do i make my character follow the cursor

Here's a couple of smoother-looking, less glitchy ways:

repeatuntilwhateveryouwantittosenseforstoppinggotox:mousex+xposition/2y:mousey+yposition/2

^This allows it to follow smoothly without turning. You can't adjust the speed, unfortunately.

If you want to adjust speed and point towards the mouse, use this:

repeatuntilwhateveryouwantittosenseforstoppingpointtowardsmouse pointermovedistancetomouse pointer/2steps

You can also use these for following sprites as well. The /2 in the second script can be adjusted to control follow speed. If you want your sprite not to turn, set the rotation style to “don't rotate.”

Hope this helped!
Failord
Scratcher
1000+ posts

How do i make my character follow the cursor

owlpillow wrote:

by the way, if you want it on the cursor


forever loop
set x to mouse x
set y to mouse y
forever loop

You mean,
gotomouse-pointer
?
ARM32
Scratcher
38 posts

How do i make my character follow the cursor

platypusProductions wrote:

I used AonymousGuy's script for following but the sprite spazes if it gets too close. I'd like to fix that but I don't know how! Please help.

How to fix that is do this:
whenclickedforeverifnotdistancetomouse-pointer<11thenmove10stepspointtowardsmouse-pointer
AonymousGuy
Scratcher
1000+ posts

How do i make my character follow the cursor

platypusProductions wrote:

I used AonymousGuy's script for following but the sprite spazes if it gets too close. I'd like to fix that but I don't know how! Please help.
whenclickedforeverpointtowardsmouse pointerifdistancetomouse pointer>10move10steps

EDIT: Oops, used less than instead of greater than. Fixed!

Last edited by AonymousGuy (Dec. 9, 2013 00:11:33)

scubajerry
Scratcher
1000+ posts

How do i make my character follow the cursor

AonymousGuy wrote:

platypusProductions wrote:

I used AonymousGuy's script for following but the sprite spazes if it gets too close. I'd like to fix that but I don't know how! Please help.
whenclickedforeverpointtowardsmouse pointerifdistancetomouse pointer>10move10steps I think this should be greater than.


Fixed
skullboy22
Scratcher
99 posts

How do i make my character follow the cursor

whenclickedforevergotomouse-pointer

if you want to make it follow the mouse pointer do it how I did cuz its less complicated

Last edited by skullboy22 (Dec. 8, 2013 22:04:55)

pongynose
Scratcher
76 posts

How do i make my character follow the cursor

whenclickedforevergotomousepointer
12424
Scratcher
65 posts

How do i make my character follow the cursor

pongynose wrote:

whenclickedforevergotomousepointer

Did you mean

whenclickedforevergotomouse pointer
Polaris10
Scratcher
63 posts

How do i make my character follow the cursor

a random scratcher person with the username of coder9902htm4a0 said wrote:

“I want to make my character follow my cursor. Can someone please tell me how i do it?”
whenclickedforevergotomouse pointer

Last edited by Polaris10 (July 7, 2015 22:12:05)

CatsUnited
Scratcher
1000+ posts

How do i make my character follow the cursor

Please don't necropost.

Powered by DjangoBB