Godot sprite offsets

November 20, 2026

The timing of me making my site and immediately pivoting to things I didn’t expect isn’t lost on me. I thought this would be a site about my home engine development primarily, but shit happens.

I’ve been learning godot for the past 2 weeks in order to collaborate with friends and to get a stab at making a small project. My home engine project is on pause for now but I will return to it in the future most likely.

Anywho, I hopped into godot as the last bastion for indies and the sentiment online was that it was a good 2D engine. I expected to be able to drop right in and start making things. Turns out godot has a massive flaw in its 2D sprite support - sprite pivots.

Searching online I found post after post about wanting sprite pivots. I’m honestly shocked that sprite pivots isn’t a thing supported out of hte box. Godot appears to want you to only use uniform sprites based on their sprite sheet selector. Using an animator player and manually keyframing each region offset is painful and not tennable if any of the data changes. I started looking at what it would take to add my own.

When creating a sprite sheet object, godot stores this in a text file. (*.tscn ) https://docs.godotengine.org/en/stable/engine_details/file_formats/tscn.html

It looks like this:

    [gd_resource type="SpriteFrames" format=3 uid="uid://cgx76s76813qu"]

    [ext_resource type="Texture2D" uid="uid://b8h2nqoayvu0d" path="res://assets/sprites/enemies/sheep_enemy_combined.png" id="1_i8kan"]

    [sub_resource type="AtlasTexture" id="sheep_attack_1"]
    atlas = ExtResource("1_i8kan")
    region = Rect2(480, 0, 405, 650)
    metadata/pivot = Vector2(-20, -110)[gd_resource type="SpriteFrames" format=3 uid="uid://cgx76s76813qu"]

    [ext_resource type="Texture2D" uid="uid://b8h2nqoayvu0d" path="res://assets/sprites/enemies/sheep_enemy_combined.png" id="1_i8kan"]

    [sub_resource type="AtlasTexture" id="sheep_attack_1"]
    atlas = ExtResource("1_i8kan")
    region = Rect2(480, 0, 405, 650)

With this method for sprite pivots you’ll be manually editing these files so get comfortable with the structures here. Godot will automatically create id’s for your sub resources, you can rename those within the same file. I did and I recommend it. In fact, the more manual control you take over these sprite sheet text files imo the better. I’ve had it create duplicate sub resources for exact duplicates which can get pretty confusing.

The sub resources here in the sprite sheet file represent “cells” of a sprite animator. These are what are selectable in the animator sequence.

I don’t know if this is the best method for godot yet - I’m pretty new to it - but godot has a feature where you can add meta data to any object. Resources and subresources allow this too. So you can add an additional piece of data per subrecource (cell) specifying the pivot position:

    [sub_resource type="AtlasTexture" id="player_attack_1"]
    atlas = ExtResource("1_i8kan")
    region = Rect2(480, 0, 405, 650)
    metadata/spriteoffset = Vector2(-20, -110) <----- your additional piece of data

You can read this data at runtime in GD Script by making your own class that extends Animator2D and specify the offset to equal this spriteoffset at runtime:

    @tool
    class_name MyAnimatedSprite2D
    extends AnimatedSprite2D

    func _process(delta: float) -> void:
        var frame_texture:Texture2D = sprite_frames.get_frame_texture(animation, frame)
        var pivot:Vector2 = frame_texture.get_meta("spriteoffset") if frame_texture.has_meta("spriteoffset") else Vector2(0,0)
        pivot.x *= -1.0 if flip_h else 1.0
        offset = pivot;

Use this class as a drop in replacement for your Animator2D nodes.

The @tool addition is just to see this at editor time. With this you can specify the offset per cell, and not be restricted to uniform cell sizes!

Example:

    sheep_enemy_spriteframes.tscn:

    [sub_resource type="AtlasTexture" id="sheep_attack_1"]
    atlas = ExtResource("1_i8kan")
    region = Rect2(480, 0, 405, 650)
    metadata/pivot = Vector2(-20, -110)

    [sub_resource type="AtlasTexture" id="sheep_attack_2"]
    atlas = ExtResource("1_i8kan")
    region = Rect2(889, 0, 550, 650)
    metadata/pivot = Vector2(-120, -110)

    [sub_resource type="AtlasTexture" id="sheep_hurt_1"]
    atlas = ExtResource("1_i8kan")
    region = Rect2(1650, 0, 320, 650)
    metadata/pivot = Vector2(-20, -110)

    [sub_resource type="AtlasTexture" id="sheep_idle_1"]
    atlas = ExtResource("1_i8kan")
    region = Rect2(0, 0, 350, 650)
    metadata/pivot = Vector2(-75, -110)

    [resource]
    animations = [{
    "frames": [{
    "duration": 4.0,
    "texture": SubResource("sheep_attack_1")
    }, {
    "duration": 1.0,
    "texture": SubResource("sheep_attack_2")
    }],
    "loop": 1,
    "name": &"attack",
    "speed": 5.0
    }

Now you can make sprites with non uniform sizes and offset them as necessary according to your animation needs!