Putting 2D character sprites in a game

I was wondering how I would be able to put 2d animated characters in a pokemon-like game I’m making.

For example, think about how Pokemon Brick Bronze had the pokemon’s pixel art in the game when fight scenes or any other time an image of a pokemon showed up. Is there any tutorials or anything on how I would be able to make this work?

More examples:


5 Likes

they probably just use gifs, upload all/most of the frames of the gif as a image then quickly change them into the next frame inside a loop

3 Likes

Sprite sheets are a thing, and are probably the best thing to use since they only require 1 image to load instead of 40 or more.

As for how, you could have a small frame with the larger sprite sheet inside, enable clip descendants and then get the positions for each sprite, put them in a table and you’re done.

There’s probably a better way to do it, so maybe search both google and the dev forums for how to make a sprite sheet function on roblox.

And then theres the gif method, which @CZXPEK already explained.
Only downside to that method is load times, and the very possible flashing image.

3 Likes

I’ll try to check out both ways you guys told me

2 Likes

I ended up putting the sprite sheet onto a part then putting a script I found from a tutorial under the texture.

local Frames = 8 --Amount of frames in gif
local currentFrame = 1

local rows = 1
local columns = 8

local currentRow,CurrentColumn = 0,0

local linear = false

local fps = 6 -- Max 30
local full60fps = false

local size = script.Parent.Parent.Size -- The gif should be on the front of the part

script.Parent.StudsPerTileU = columns*size.X
script.Parent.StudsPerTileV = rows*size.Y

while true do
	if not full60fps then wait(1/fps) else game:GetService("RunService").Stepped:Wait() end
	if linear then
		script.Parent.OffsetStudsU = script.Parent.OffsetStudsU + size.X
		if script.Parent.OffsetStudsU > script.Parent.StudsPerTileU then
			script.Parent.OffsetStudsU = 0
		end
	else
		CurrentColumn = CurrentColumn + 1
		if CurrentColumn > columns then
			CurrentColumn = 1
			currentRow = currentRow + 1
		end
		if currentFrame > Frames then
			currentRow,CurrentColumn,currentFrame = 1,1,1
		end
		script.Parent.OffsetStudsU = size.X*(CurrentColumn-1)
		script.Parent.OffsetStudsV = size.Y*(currentRow-1)
		currentFrame = currentFrame+1
	end
end

5 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.