Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I can't make my sprite face the direction he is moving.
- TheSandwichViking
-
3 posts
I can't make my sprite face the direction he is moving.
I am creating a game for a computing class, and the game will involve a room full of npc sprites that wander around randomly, (they don't need to interact with anything). I can make them move around randomly, and I have given them simple walk cycles, but I can't manage to make them face the direction they are moving. I could make them face left, right up and down, but I really want them to be able to face 360 degrees, and change as they change direction.
- awesome-llama
-
1000+ posts
I can't make my sprite face the direction he is moving.
There is an input with the dropdown, so you can set directions other than the dropdown choices of -90, 0, 90 and 180.
I find your post hard to understand. I think you also want smooth rotation, instead of just instantly facing direction.
- TheSandwichViking
-
3 posts
I can't make my sprite face the direction he is moving.
That's not the problem sorry. I've made a sprite that moves around totally randomly, 360 degrees of choice, anywhere on screen. I want him to face the direction he is moving. I will not be controlling him, there is no input. I'm hopeless at this.
- Candylanguagegirl
-
1000+ posts
I can't make my sprite face the direction he is moving.
Could you share the project? It's usually easier to work with coding when you can have it in the editor and can test it.
Also, this should go in the help with scripts forum. I'll report it to be moved for ya.
Also, this should go in the help with scripts forum. I'll report it to be moved for ya.

- spyroclub1
-
18 posts
I can't make my sprite face the direction he is moving.
Hope this helps!

- dov3lyn
-
100+ posts
I can't make my sprite face the direction he is moving.
Try I am creating a game for a computing class, and the game will involve a room full of npc sprites that wander around randomly, (they don't need to interact with anything). I can make them move around randomly, and I have given them simple walk cycles, but I can't manage to make them face the direction they are moving. I could make them face left, right up and down, but I really want them to be able to face 360 degrees, and change as they change direction.
Then,
Hope this helps!

- Thelnvoker
-
100+ posts
I can't make my sprite face the direction he is moving.
Try using this block:
For right, do 90 degrees, left, -90 degrees, up, 0 degrees, and down, 180 degrees.
For instance:
Hope this helps!
For right, do 90 degrees, left, -90 degrees, up, 0 degrees, and down, 180 degrees.
For instance:
Hope this helps!
- deck26
-
1000+ posts
I can't make my sprite face the direction he is moving.
Your explanation isn't totally clear but it sounds like a rotation style problem.
If it doesn't matter if the sprite is upside down, for example a top-down view) and it can turn in any direction just make sure the rotation style is set to all-round. Also make sure that the costume faces right in the costume editor - in the editor it should always be as you want it to appear when facing right (90 degrees).
If you want to avoid the problem of a sprite ending up upside down you have to do more work with separate costumes but it would be easier to help if we can see what you have.
If it doesn't matter if the sprite is upside down, for example a top-down view) and it can turn in any direction just make sure the rotation style is set to all-round. Also make sure that the costume faces right in the costume editor - in the editor it should always be as you want it to appear when facing right (90 degrees).
If you want to avoid the problem of a sprite ending up upside down you have to do more work with separate costumes but it would be easier to help if we can see what you have.
- asivi
-
1000+ posts
I can't make my sprite face the direction he is moving.
Perhaps you are moving with “glide_secs_to_x_y”, if this is your case create 2 variables for random coodinates 1 for x and the orher for y positions
Last edited by asivi (Oct. 10, 2016 09:59:38)
- mario
-
9 posts
I can't make my sprite face the direction he is moving.
Try using this block:
For right, do 90 degrees, left, -90 degrees, up, 0 degrees, and down, 180 degrees.
For instance:
Hope this helps!
- deck26
-
1000+ posts
I can't make my sprite face the direction he is moving.
Please don't necropost.Try using this block:
For right, do 90 degrees, left, -90 degrees, up, 0 degrees, and down, 180 degrees.
For instance:
Hope this helps!
- logicil
-
54 posts
I can't make my sprite face the direction he is moving.
Idk if I did it right, but this method didn't work for me. Does it have to be squared? Perhaps you are moving with “glide_secs_to_x_y”, if this is your case create 2 variables for random coodinates 1 for x and the orher for y positions
Yes I know this is technically necroposting, but I'd rather not create a new thread.
Last edited by logicil (Nov. 5, 2019 00:39:39)
- Trevisiol17
-
2 posts
I can't make my sprite face the direction he is moving.
I’m trying to do this on iPad
- scratchPro86
-
15 posts
I can't make my sprite face the direction he is moving.
But how do you do it with left and right arrows
I know that
But how do you do it with left and right arrow keys??
I know that
But how do you do it with left and right arrow keys??
- deck26
-
1000+ posts
I can't make my sprite face the direction he is moving.
Please create your own topic rather than necroposting. But how do you do it with left and right arrows
I know that
But how do you do it with left and right arrow keys??
- Texesh
-
1 post
I can't make my sprite face the direction he is moving.
Change the orientation of the sprites in costumes
- bubbyballbounce
-
2 posts
I can't make my sprite face the direction he is moving.
I'm on mobile and I use the touchscreen to move the character around on my game I'm working on but I want him to look in the direction of his motion so he looks in the direction he moves also there isn't a dpad or anologue stick to move the character. He can be moved with the arrow keys or if you click a button, he goes to the mouse's position or where you tap or you tap and drag, please help me, pointing in the direction doesn't work just to let you know
- Discussion Forums
- » Help with Scripts
-
» I can't make my sprite face the direction he is moving.