Discuss Scratch

Remoraid81
Scratcher
53 posts

How to make a sprite look in the direction its going in?

I have made my sprite move randomly like this -
glidepickrandom1to5secstox:pickrandom...to...y:pickrandom...to...
But my sprite would always face right.
How do I make it look in the right direction when it moves randomly?

Last edited by Remoraid81 (March 25, 2016 01:42:17)

deck26
Scratcher
1000+ posts

How to make a sprite look in the direction its going in?

Make sure the costume is facing right in the editor.

If the sprite is something like a person set rotation style to left-right and make sure you point in the direction you're going to move.

If the sprite can rotate all round set that rotation style and again make sure you point in the direction you want to move.
asivi
Scratcher
1000+ posts

How to make a sprite look in the direction its going in?

To point towards you want glide try this example
TBoneMiller07
Scratcher
6 posts

How to make a sprite look in the direction its going in?

can i help
Remoraid81
Scratcher
53 posts

How to make a sprite look in the direction its going in?

I have edited the post
asivi
Scratcher
1000+ posts

How to make a sprite look in the direction its going in?

this block allows left and right facing
setrotationstyleleft-right
Mango56789
Scratcher
6 posts

How to make a sprite look in the direction its going in?

Last edited by Mango56789 (April 19, 2018 06:43:21)

asivi
Scratcher
1000+ posts

How to make a sprite look in the direction its going in?

Mango56789 wrote:


whenclickedhidegotox:0y:0setrotationstyleleft-rightswitchcostumetocostume2createcloneofmyselfwait1secsforevergotorandom positionbroadcastglideandwaitwhenIstartasacloneswitchcostumetocostume1showwhenIreceiveglideifcostume#=1thenpointtowardsSprite1glidedistancetoSprite1/100secstox:x positionofSprite1y:y positionofSprite1

HERE IS IT
jonthecat123
Scratcher
1 post

How to make a sprite look in the direction its going in?

eh?
deck26
Scratcher
1000+ posts

How to make a sprite look in the direction its going in?

jonthecat123 wrote:

eh?
Please don't necropost. Create your own topic if you have a question.
TheCodingLamp
Scratcher
49 posts

How to make a sprite look in the direction its going in?

Righto. You need a bit of math for this. OR you could use a bit of a trick.

You can first make a new sprite. It can be completely blank, and make sure you hide it so it doesn't interrupt the project.

Now, before the glide, move the new sprite to whatever destination you're gliding to.

You can now run the “point towards (The NewSprite's Name)” before gliding.

Hope this helped!
bsteichman
Scratcher
500+ posts

How to make a sprite look in the direction its going in?

use this in your code that moves randomly
setrotationstyledon't rotate
your sprite will move randomly but face the same direction.
and if you want your sprite to rotate again use
setrotationstyleleft right
in that code…

Last edited by bsteichman (April 19, 2021 13:15:42)

water_guy1212
Scratcher
1 post

How to make a sprite look in the direction its going in?

BRUH DATS A LIE
Theroverbowman
Scratcher
6 posts

How to make a sprite look in the direction its going in?

Remoraid81 wrote:

I have made my sprite move randomly like this -
glidepickrandom1to5secstox:pickrandom...to...y:pickrandom...to...
But my sprite would always face right.
How do I make it look in the right direction when it moves randomly?

you can just make another costume and flip it horizontally.

Powered by DjangoBB