Discuss Scratch

PixelPark
Scratcher
100+ posts

How do I make a sprite float after another?

I really want to learn how to make a sprite float after another, like a buddy in The Binding of Isaac.
This could also be used in an RPG, so your party members could follow you.

Does anyone have any suggestions on what I could do?
Am I on the right track by considering motion tracking?



pwned95
Scratcher
10 posts

How do I make a sprite float after another?

Well you could use a script like this:
repeat until (distance to “object”<50):
point in direction of “object”
move 3 steps
wait until (distance to “object”>50)
repeat
BKFighter
Scratcher
1000+ posts

How do I make a sprite float after another?

I assume you mean like just behind their shoulder. Just have them be a bit higher than
yofto follow sprite
, and use the direction of them to determine whether to place on the left or right side of the screen.
PixelPark
Scratcher
100+ posts

How do I make a sprite float after another?

pwned95 wrote:

Well you could use a script like this:
repeat until (distance to “object”<50):
point in direction of “object”
move 3 steps
wait until (distance to “object”>50)
repeat
I'm gonna try this, I'll share my results in this feed! Thanks!
PixelPark
Scratcher
100+ posts

How do I make a sprite float after another?

Powered by DjangoBB