Discuss Scratch

bradg20
Scratcher
69 posts

sprite direction!

How do I get my sprite to face the direction he is moving
deck26
Scratcher
1000+ posts

sprite direction!

In the costume editor the costume should be the way it will appear when the sprite is facing right (90 degrees). Then choose between the rotation styles - left-right for a sprite that only faces left or right or all round for one that can rotate completely.

In most cases you'll only need to set the rotation style once so you can do it in a green flag script or select it in the sprite's information section (click the blue i).
bradg20
Scratcher
69 posts

sprite direction!

yeah but say he starts heading one direction, and then another. I want him to change direction to look like he is moving forward
deck26
Scratcher
1000+ posts

sprite direction!

How are you moving the sprite though? If you don't use the ‘point in direction’ block or one of the turn blocks the sprite won't turn.
bradg20
Scratcher
69 posts

sprite direction!

i have him gliding to random positions but don't know how to make him point in the he is gliding
deck26
Scratcher
1000+ posts

sprite direction!

bradg20 wrote:

i have him gliding to random positions but don't know how to make him point in the he is gliding
What you could do is have a ghosted sprite.

Store the x and y coords of the point you're aiming for in variables and do a broadcast to get the ghosted sprite to go there. Then point towards the ghosted sprite before doing the glide.
bradg20
Scratcher
69 posts

sprite direction!

That is a great idea gonna do that Thanks for the help deck26

Powered by DjangoBB