Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » previous costume workarounds not working
- ASTRONEERboi
-
Scratcher
100+ posts
previous costume workarounds not working
I've been trying to do a previous costume workaround for a platformer I'm making at the moment, but when I tried the workarounds, they didn't work. Instead of the script making the sprite go to the previous costume, the script just made the sprite go to the next costume. Could someone tell me why this is happening and how I could fix it?
The workarounds I did:
The workarounds I did:
switch costume to (join [previous costume] []
switch costume to ((costume [number v] :: looks) - (1))
- Link2358
-
Scratcher
100+ posts
previous costume workarounds not working
I tested these out again and they still work, perhaps you used the wrong operator, or spelt it wrong. OR there may be something else at play, if you are completely sure you have spelt it right/ used the right operator, you should share the project .
- -motionless-
-
Scratcher
100+ posts
previous costume workarounds not working
I tested these out again and they still work, perhaps you used the wrong operator, or spelt it wrong. OR there may be something else at play, if you are completely sure you have spelt it right/ used the right operator, you should share the project .you might have put
(costume name)instead of
(costume number)
- medians
-
Scratcher
1000+ posts
previous costume workarounds not working
Those should work fine, for the first one, did you make sure not to add any extra spaces and did you put it exactly like above (it's case sensitive). Also, is the dropdown a new thing?
- ASTRONEERboi
-
Scratcher
100+ posts
previous costume workarounds not working
(#2)
I tested these out again and they still work, perhaps you used the wrong operator, or spelt it wrong. OR there may be something else at play, if you are completely sure you have spelt it right/ used the right operator, you should share the project .
I used the right operator, and I spelt it right.
The project is: https://scratch.mit.edu/projects/841842418
- ASTRONEERboi
-
Scratcher
100+ posts
previous costume workarounds not working
(#4)
Those should work fine, for the first one, did you make sure not to add any extra spaces and did you put it exactly like above (it's case sensitive). Also, is the dropdown a new thing?
I didn't add extra spaces. And yes, I put it exactly like above.
- 09878901234321
-
Scratcher
500+ posts
previous costume workarounds not working
The issue does not reside in the costume-switching code itself, but instead in the broadcasts that tell it to switch costumes. Whenever you go the left side of the screen, “NextArea1” is broadcast. Instead, “PreviousArea1” should be broadcast.


- ASTRONEERboi
-
Scratcher
100+ posts
previous costume workarounds not working
(#7)
The issue does not reside in the costume-switching code itself, but instead in the broadcasts that tell it to switch costumes. Whenever you go the left side of the screen, “NextArea1” is broadcast. Instead, “PreviousArea1” should be broadcast.
Ok. It seems to work now.
- Discussion Forums
- » Help with Scripts
-
» previous costume workarounds not working