What is the issue? Include screenshots / videos if possible!
I’m not that good of a scripter and I don’t know how to script with sprite sheets to make animations. Also, the sprite sheet contains sprites for 2 different animations, and I want to know how to separate those animations and name them so I can use them for whatever I need.
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried finding some posts on the dev forums that might help me but they don’t have what I’m looking for.
I did something similar to this with GIFs and SurfaceGUI, my friend showed me this handy script. You could most likely modify this to work for your case. I like this one in particular because you can control the FPS. It’s set up where you can have multiple GIFs on a screen, and switch them with a command. To convert your GIFs into a sprite sheet, you can use this if you need to.
Note: You can ignore the plr = owner stuff, that’s because it was made to work on a special case.
You could do something like this, though it is very inefficient.
while true do
wait()
script.Parent.ImageRectOffset = Vector2.new(240,240)
for i = 1,4 do
wait(1)
script.Parent.ImageRectOffset = Vector2.new(script.Parent.ImageRectOffset.X+240,240)
end
end
You will need to change the image size and offset too.
Change the vector2 values to whatever flips to the next frame.
Thanks! Since the spritesheets are really big I can just seperate each of them for each animation.
Example (yes im using fnf/friday night funkin’ spritesheets):
Is there a site where I can find the fps for the spritesheet im using? The spritesheet im using isnt mine and is taken from a game outside of roblox, so I dont know the fps of it.
The FPS doesn’t have to be the same as the GIF. I don’t know much about FNF, but the animations are probably 30 FPS, to keep traditional with flash games. If that doesn’t look right, you can just play around with it until it looks good.
I have a question, how would I make it so for the idle animation it starts at the frame i want it to instead of the first frame? Since the first frame is for another animation thats not the idle animation.
You could maybe set the currentFrame to the start of the idle animation, but you’d have to do some code logic yourself for that. If you’d want to do it multiple times, you could add a new option called startingFrame or something, so you wouldn’t have to specify it for each gif that needs it.
Oh wait, I get why It’s not working ImageLabels use ImageRectOffset and I just deleted the studspertile which I think is what makes it work. So I would have to change studspertile to ImageRectOffset