Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to make a sprite go back to standing costume?
- Baselira
-
15 posts
How to make a sprite go back to standing costume?
The code I have is changing costumes while running, but when it stops running(the player stops holding down the key) it stays in the running costume. I've tried various “If” scripts that don't work, and if I incorporate it at the end of the script it adds an extra weird frame that makes it much less smooth and makes it look glitchy. Is there a script that can make it so when the player stops pressing on the button the costume switches to the standing position?
- deck26
-
1000+ posts
How to make a sprite go back to standing costume?
You must have a script or loop that is active when the sprite is running. If you switch costume when the running stops that should be enough. Sharing the project would help.
- Baselira
-
15 posts
How to make a sprite go back to standing costume?
Okay, heres the link: You must have a script or loop that is active when the sprite is running. If you switch costume when the running stops that should be enough. Sharing the project would help.
https://scratch.mit.edu/projects/80519746/
Itll stay in the running position when I stop pressing the key. And also, I've tried the switch the costumes for running, then if else switch to standing but it doesnt work when I do that ;-;
- deck26
-
1000+ posts
How to make a sprite go back to standing costume?
At the moment your project has no green flag scripts so it is only responding to key presses and when no key is pressed it is not going to do anything.
What you should do is have a green flag script which contains a forever loop looking for key presses rather than using the keypress hat block.
What you should do is have a green flag script which contains a forever loop looking for key presses rather than using the keypress hat block.
So where I have red blocks you should actually be putting in the code you currently have for that key press.
- Baselira
-
15 posts
How to make a sprite go back to standing costume?
OH it worked! I had this problem in one of my other games, now its solved! Thanks, this was SO helpful ;c; At the moment your project has no green flag scripts so it is only responding to key presses and when no key is pressed it is not going to do anything.
What you should do is have a green flag script which contains a forever loop looking for key presses rather than using the keypress hat block.So where I have red blocks you should actually be putting in the code you currently have for that key press.
Last edited by Baselira (Oct. 9, 2015 21:45:48)
- Grofskembo
-
1 post
How to make a sprite go back to standing costume?
Well, im having the same problem but i have two costumes for standing positions (eg. after running to left staying in standing position but turned to left side and opposite) is that possible using Scratch commands?
- deck26
-
1000+ posts
How to make a sprite go back to standing costume?
Best to start your own new topic rather than necroposting. Sharing what you have is also a good idea. Do you really need two standing costumes? Well, im having the same problem but i have two costumes for standing positions (eg. after running to left staying in standing position but turned to left side and opposite) is that possible using Scratch commands?
- Discussion Forums
- » Help with Scripts
-
» How to make a sprite go back to standing costume?