Skip to content

How to change displayed sprite? (Unity 2D)

Not downloaded yet

So I'm currently trying to make it so the arrows on the sides can switch among the shirts & pants. My idea is that the scene will load with both at index 0 (both shirt and pants slot being empty). Left arrow for either decreases the respective article's index by 1 (switching to 3 when at 0 or 1, to avoid returning to blank) and the right arrows increasing the index by 1 (switching to 1 when increasing from 3)... Any suggestions? Also, I figured there's no point in showing my code, because I have no clue where to start lol. Thank you in advance!

https://preview.redd.it/hfj9xiz5vfy81.png?width=1920&format=png&auto=webp&s=5779989e825e6d929dfe4f1d7f3967dacb0f50ae

1 points0 comments
Open on Reddit
About this post
Posted
Archived
Score
1 · 100% up
Kind
Image
ID
ulpfiu

Author

12
posts
31
comments
3
media
View profile
Nobody had commented when we saved it.

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.