Gridwright Start for $1

2D Character Creator: Make a Platformer Character Sprite

Make a platformer character sprite in a 2D character creator: one frame size, 13 animations, an attack per weapon, and feet that stay still in Godot 4.

Hero Creator at work
Hero Creator at work: Side-view platformer heroes.

Your platformer controller works. The jump feels right, coyote time is in, and the hero is still a coloured rectangle. Every tutorial stops at "now add your art", and the art list turns out longer than the code: a run, a jump, an attack, getting hit, dying, all facing both ways, all standing on the same feet.

Then the small things go wrong. The hero hops sideways every time he turns. The sword deals damage before it is swung. The jump looks wrong in the air. And the attack you drew for the sword looks silly with an axe.

This guide covers what a side-view platformer hero sprite needs: the frame size, the animations, one attack per weapon, facing left by mirroring, and a Godot 4 setup that keeps the feet still. Then it shows the Hero Creator building one from layers. You can try it here while you read.

Pick a frame size with room to swing

A platformer hero is small, but its weapon isn't. In the Hero Creator the standing hero is about 16 to 20 pixels wide inside a 48x48 cell, and the sword's slash ends 2 pixels from the cell's right edge. A cell drawn tight around the body would cut the weapon off in the frame that matters most.

Hero Creator in use
Hero Creator in use. Every tool runs in your browser, nothing to install.

Two rules matter more than the size itself:

  • One cell size for every animation. Idle, run and the attacks share one 48x48 grid, so one frame number picks the same spot in any row.
  • The feet on the same row in every frame. In the Hero Creator they stand on row 47, the bottom row, with the feet pivot at x 21. If the feet move between frames, the hero bobs whenever one animation changes to the next.

The sheet has one row per animation and 6 columns: 288x624 pixels at 1x.

The animations a platformer needs

AnimationFramesFPSPlaysFor
idle46loopsstanding still without looking frozen
walk610loopsslow movement
run612loopsfull speed
jump410oncetake-off, two frames in the air, landing
slash, chop, thrust, stab, shoot, smash4 or 510 to 14onceone attack per weapon
cast510oncemagic, with any weapon
hurt28oncethe reaction to a hit
death58oncegame over or a respawn

That is 13 animations and 61 frames per hero. The jump needs care in code, because it follows the physics, not the clock. Its first and last frames touch the ground and the middle two are in the air. Play the take-off when the jump starts, hold the last air frame while the hero is airborne, and show the landing frame when is_on_floor() turns true again. There is no separate fall row, so that air frame covers the fall too.

Hero Creator in use
Hero Creator in use. Every tool runs in your browser, nothing to install.

One attack per weapon

A sword, an axe, a spear, a dagger, a bow and a staff don't move the same way, so each has its own attack row: the sword slashes, the axe chops, the spear thrusts, the dagger stabs, the bow shoots (a draw and release, with the arrow) and the staff smashes. Cast works with any of them.

Side-View Characters
Side-View Characters: 10 animated 32x32 pixel art heroes and enemies: run, jump, attack, hurt and death, left and right. One of the 150 packs in Gridwright.

A weapon layer is drawn in idle, walk, run, jump, cast, hurt and death, and in its own attack row. In the other attack rows it is empty, so an axe hero playing the slash row swings an empty hand. Pick the attack from the weapon:

const ATTACK := {"sword": "slash", "axe": "chop", "spear": "thrust",
		"dagger": "stab", "bow": "shoot", "staff": "smash"}

func attack(weapon: String) -> void:
	play(ATTACK[weapon])

Damage should land when the blade is out, not when the button is pressed. The Side-View Hero Creator pack's layers.json lists the hit frame of every attack, a hit box per weapon, and the points where the arrow and the magic bolt leave the hand. Its frame numbers count from 1 and Godot's frame counts from 0, so the sword's hit frame 3 is frame == 2: the frame where the slash reaches furthest. Check for it in the frame_changed signal and switch the hit box on there.

Facing left: mirror, but keep the feet still

The Hero Creator's left-facing sheets are the right-facing cells mirrored one by one, so nothing is drawn twice. In Godot, flip_h does the same while the game runs.

Isometric Fantasy Villagers
Isometric Fantasy Villagers: 18 isometric pixel art fantasy villagers in 8 directions: idle, walk and a work animation each. One of the 150 packs in Gridwright.

The catch is where it mirrors. flip_h flips the picture inside its own 48-pixel box, and the hero's feet are at x 21, not in the middle at 24. With the sprite centred, as it is by default, the Knight's feet moved 4 pixels every time he turned in our Godot 4.7.2 test. The player sees a hop, and the body box no longer sits under the feet.

The fix: turn Centered off and change the offset with the facing. Facing right the offset is (-21, -48); facing left it is (-27, -48), the mirror of the same point. In our test the feet then stood on the node's origin both ways, mirrored around it, so a collision shape whose bottom is at 0 sits right under them. Setting scale.x = -1 with the right-facing offset put the feet in the same place. Hit boxes and spawn points flip too: their x, measured from the feet, changes sign.

Bring the sheet into Godot 4

Export the sheet at 1x and let Godot scale the whole game; the Godot pixel perfect settings guide covers that. The JSON next to the sheet is Aseprite-style: a rectangle and a duration for every frame, and a tag per animation.

Godot Platformer Character Builder: A Godot 4 platformer character that runs and jumps right, made from your side-view sprite sheet
Godot Platformer Character Builder: A Godot 4 platformer character that runs and jumps right, made from your side-view sprite sheet. Included in Gridwright.

This script turns it into a SpriteFrames, every animation named and at its speed, with only idle, walk and run looping. Attach it to an AnimatedSprite2D under your CharacterBody2D, call load_hero("res://my_hero_1x.png", "res://my_hero_1x.json") once, then face(velocity.x) every physics frame:

extends AnimatedSprite2D

const CELL := 48
const FEET_X := 21  # the feet pivot: x 21, standing on the cell's bottom
const LOOPS := ["idle", "walk", "run"]

func load_hero(sheet_path: String, json_path: String) -> void:
	var sheet: Texture2D = load(sheet_path)
	var data: Dictionary = JSON.parse_string(FileAccess.get_file_as_string(json_path))
	var frames := SpriteFrames.new()
	frames.remove_animation("default")
	for tag in data.meta.frameTags:
		var first: int = tag.from
		var last: int = tag.to
		frames.add_animation(tag.name)
		frames.set_animation_loop(tag.name, tag.name in LOOPS)
		frames.set_animation_speed(tag.name, roundf(1000.0 / data.frames[first].duration))
		for i in range(first, last + 1):
			var r: Dictionary = data.frames[i].frame
			var atlas := AtlasTexture.new()
			atlas.atlas = sheet
			atlas.region = Rect2(r.x, r.y, r.w, r.h)
			frames.add_frame(tag.name, atlas)
	sprite_frames = frames
	centered = false
	texture_filter = TEXTURE_FILTER_NEAREST
	face(1.0)

func face(dir_x: float) -> void:
	if dir_x == 0.0:
		return  # standing still: keep the last facing
	flip_h = dir_x < 0.0
	offset = Vector2(FEET_X - CELL if flip_h else -FEET_X, -CELL)

We ran it in Godot 4.7.2 on a Knight exported in this layout: all 13 animations came out with the right frame counts, speeds and loops, and a hero standing still kept his last facing. The attack function above goes in the same script.

To click the frames in by hand instead, see the Godot sprite sheet animation guide. For a finished controller with a jump set by its height, coyote time and a jump buffer, the Godot Platformer Character Builder reads a side-view sheet with our JSON and gives you the scene.

Build the hero in the Hero Creator

The Hero Creator mixes 192 layers on the 48x48 hero, and every layer fits every frame of all 13 animations:

  1. Start from a ready-made hero or a bare body. There are 16, from the Knight, the Ranger and the Mage to the Viking, the Orc Raider and the Battle Princess.
  2. Dress it. 8 skin tones, 8 hair styles in 6 colours, beards, tops, legs, boots, gloves, leather and plate armour, helmets and hats, capes, round and kite shields, and 6 weapons in 3 finishes each. Random picks a whole look and jumps to its weapon's attack.
  3. Play every animation facing right or left, with the effects layer (slashes, thrust lines, magic sparks, dust) shown or hidden.
  4. Export the sheet at 1x to 4x with its JSON.
Your game, looking finished

Every Gridwright asset pack, made to fit together, and all 44 tools for the fiddly work, with every new release, for $17 a month. Try it in your own game first: 3 days for $1 with every tool and up to 10 packs. Cancel any time.

Start: 3 days for $1 See everything it includes

What the demo does

Try it here. The free demo has the Knight and the Ranger and their layers, plus a few more: 24 layers and the effects. It plays all 13 animations facing right or left and exports the sheet and its JSON at 1x to 4x, so you can test the whole Godot setup above with it.

The full Hero Creator has all 192 layers and the 16 ready-made heroes, and your work is saved to your account.

When the hero looks wrong

  • He hops when he turns. The sprite is centred, or the offset doesn't change with flip_h.
  • The hit lands a frame early or late. A hit frame from layers.json was used as Godot's frame. Subtract 1.
  • The weapon vanishes in the attack. The hero is playing another weapon's row.
  • It looks blurry. Set the filter to Nearest.

Give the rectangle a face today

Open the Hero Creator, start from the Knight, give him the Ranger's bow and export the sheet. The Side-View Hero Creator pack has the same layers as PNGs, with layers.json and its hit frames. Both are part of Gridwright, with 44 tools and 150 asset packs.

Your game, looking finished

Every Gridwright asset pack, made to fit together, and all 44 tools for the fiddly work, with every new release, for $17 a month. Try it in your own game first: 3 days for $1 with every tool and up to 10 packs. Cancel any time.

Start: 3 days for $1 See everything it includes