This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2013-01-20 05:48:55

Gagamonster105
Scratcher
Registered: 2012-11-29
Posts: 100+

Following

How do you get one sprite to follow another?


http://i46.tinypic.com/14bklrq.png <click

Offline

 

#2 2013-01-20 08:33:18

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Following

Go towards another or follow the exact path of another?  If you just want to go towards:

when gf clicked
forever
point towards [sprite 1 v]
move (1) steps


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#3 2013-01-20 08:34:14

numberonegamers
Scratcher
Registered: 2012-07-12
Posts: 100+

Re: Following

When gf clicked
Forever
 Point towards [a sprite you want it to follow. v]
 Move [x] steps
End
Hope that helps. And on the move x steps, choose x to be how fast.

Ok, I just posted this up and someone posted the exact thing 1 second earlier!

Last edited by numberonegamers (2013-01-20 08:34:57)

Offline

 

#4 2013-01-20 11:58:36

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Following

For smoother motion:

when gf clicked
forever
point towards [someSprite v] 
move ((distance to [someSprite v]) / (10)) steps
end
Adjust the value that the distance is divided by (10 right now) to change speed.  Larger numbers = slower, smaller numbers = faster.

Offline

 

Board footer