Skip to content
godot-sync-static-positions logo

Sync Static Positions

godot-sync-static-positions

Use when Godot nodes have position set in both .tscn (editor) and _ready() (code), creating confusion about actual runtime position. Detects static position assignments that conflict with editor values. Syncs to single source of truth, making editor preview match game behavior (WYSIWYG).

Asreonn/godot-superpowers0installs4stars

SKILL.md

Full skill instructions

Sync Static Positions

Core Principle

What You See Is What You Get. Editor preview should match game behavior for static positions.

What This Skill Does

Finds conflicts like:

# enemy.gd
func _ready():
    position = Vector2(500, 300)  # Code says here

# enemy.tscn
[node name="Enemy" type="CharacterBody2D"]
position = Vector2(100, 100)  # Editor says here

# RESULT: Confusing! Editor shows wrong position

Resolves to:

# enemy.gd
func _ready():
    # Position is set in scene file for editor visibility
    pass

# enemy.tscn
[node name="Enemy" type="CharacterBody2D"]
position = Vector2(500, 300)  # Updated to match intended position

# RESULT: Editor preview matches game

Detection Patterns

Identifies:

Direct Position Assignment in _ready()

func _ready():
    position = Vector2(100, 150)  # STATIC CONFLICT
    global_position = Vector2(500, 300)  # STATIC CONFLICT

Node Property Assignment

func _ready():
    $Sprite.position = Vector2(10, 20)  # Child position conflict
    get_node("CollisionShape2D").position = Vector2(0, 0)

Multiple Property Conflicts

func _ready():
    position = Vector2(100, 100)
    rotation = deg_to_rad(45)  # Also position-related
    scale = Vector2(2, 2)

When to Use

Level Design Workflow

Placing objects in editor but code overrides positions.

Debugging Position Issues

"Why is this node in the wrong place?"

Maintaining WYSIWYG

Want editor preview to be accurate.

Preparing for Collaboration

Level designers need accurate editor preview.

Process

  1. Scan - Find position assignments in _ready()
  2. Compare - Check against .tscn values
  3. Detect Conflicts - Identify static conflicts (not dynamic)
  4. Choose Strategy - User selects sync direction
  5. Apply - Update .tscn or .gd files
  6. Document - Add comments explaining ownership
  7. Validate - Ensure positions match across editor/​game
  8. Commit - Git commit per conflict resolution

Sync Strategies

Strategy 1: Editor Wins (Recommended for Static Positions)

Move code value to .tscn, remove from code.

When to use:

  • Position should be visible in editor
  • Designer-controlled placement
  • Static object positioning

Example:

# Before
func _ready():
    position = Vector2(500, 300)

# After
func _ready():
    # Position is set in scene file
    pass
# enemy.tscn updated
position = Vector2(500, 300)

Strategy 2: Code Wins (Keep Dynamic)

Remove editor value, keep code assignment.

When to use:

  • Position calculated at runtime
  • Depends on other nodes/​data
  • Procedural positioning

Example:

# Before
func _ready():
    position = spawn_point.position + offset  # Dynamic!

# After
func _ready():
    # Position is dynamically calculated (see spawn_point)
    position = spawn_point.position + offset
# enemy.tscn - position removed or set to (0,0) as placeholder

Strategy 3: Document Intent

Keep both but add clear comments.

When to use:

  • Initial position in editor, overridden intentionally
  • Default position with code override
  • Both values have meaning

Example:

# Before
func _ready():
    position = start_position

# After
func _ready():
    # Editor position is default spawn, overridden to start_position
    position = start_position

Smart Detection

Identifies STATIC conflicts (fixes these):

func _ready():
    position = Vector2(100, 100)  # Literal constant - STATIC
    position = Vector2(CONSTANT_X, CONSTANT_Y)  # Constants - STATIC
    $Child.position = Vector2(10, 10)  # Literal - STATIC

Skips DYNAMIC positioning (intentional):

func _ready():
    position = player.position  # Variable reference - DYNAMIC
    position = get_spawn_point()  # Function call - DYNAMIC
    if some_condition:
        position = Vector2(100, 100)  # Conditional - DYNAMIC

func _process(delta):
    position = target  # Every frame - DYNAMIC (skip)

Key distinction: Static = same every time, Dynamic = varies at runtime

What Gets Created

  • Synced .tscn files with correct positions
  • Updated or cleaned code files
  • Comments documenting position ownership
  • Validation ensuring sync worked
  • Git commits per sync operation

Common Conflicts

Conflict 1: Spawn Position

# Before: Code says (500, 300), editor says (0, 0)
func _ready():
    position = Vector2(500, 300)

# After: Editor updated, code removed
# enemy.tscn: position = Vector2(500, 300)

Conflict 2: Child Node Offset

# Before: Child offset in code, not editor
func _ready():
    $Sprite.position = Vector2(0, -10)

# After: Sprite position moved in .tscn
# enemy.tscn: [node name="Sprite"] position = Vector2(0, -10)

Conflict 3: Multiple Properties

# Before: Position, rotation, scale all in code
func _ready():
    position = Vector2(100, 100)
    rotation = deg_to_rad(45)
    scale = Vector2(1.5, 1.5)

# After: All properties in .tscn, code clean
# enemy.tscn has all three properties set

Integration

Works with:

  • godot-sync-camera-positions - Camera-following elements
  • godot-sync-parallax - Parallax-specific syncing
  • godot-clean-conflicts - General conflict resolution
  • godot-fix-positions (orchestrator) - All position sync operations

Safety

  • Original positions preserved in git
  • Validation ensures sync correctness
  • Rollback on validation failure
  • .tscn format preserved exactly

When NOT to Use

Don't sync if:

  • Position is calculated dynamically
  • Position varies based on game state
  • Intentional position override pattern
  • Position set in _process() (every frame)

Valid code-controlled positions:

# These should NOT be synced to .tscn
func _ready():
    position = get_spawn_location_from_data()  # Data-driven
    position = player.position + offset  # Relative to player
    position = area.get_random_point()  # Procedural

Benefits

  • WYSIWYG - Editor shows accurate positions
  • Designer-Friendly - Level design in editor, not code
  • Debugging - Obvious where position comes from
  • Consistency - Clear ownership pattern
  • Visualization - Preview exactly matches game

Position Ownership Patterns

After syncing, clear patterns emerge:

Position TypeOwnerExample
Static spawn pointsEditor (.tscn)Enemy spawn locations
Child node offsetsEditor (.tscn)Sprite relative to parent
Dynamic positionsCode (_ready, _process)Follow player, procedural
Animation positionsAnimationPlayerAnimated movement
Physics positionsPhysics engineRigidBody2D

Validation

After syncing, validates:

  • .tscn file parses correctly
  • Position values match intended target
  • References (@onready) still work
  • Scene loads without errors
  • Visual position matches code position

Documentation Added

# Position is set in scene file at (500, 300)
# Rotation is controlled by AnimationPlayer "rotate"
# Scale is controlled by code (dynamic resizing based on health)

Clear ownership = clear code = fewer bugs.

More skills from Asreonn

godot-sync-camera-positions logo
Asreonn/godot-superpowers

godot-sync-camera-positions

Use when Godot background layers or elements follow the camera at runtime but show incorrect position in editor. Detects camera-following patterns and syncs editor position to match typical runtime state. Makes editor preview accurately show what players will see during gameplay.

4 0
View
godot-refactor logo
Asreonn/godot-superpowers

godot-refactor

Use when Godot project has code-created objects, tight coupling via direct references, monolithic scripts over 150 lines, or needs scene-first architecture with signals and composition. Orchestrates all 5 code quality mini-skills: extract-to-scenes, split-scripts, add-signals, extract-resources, ...

4 0
View
godot-split-scripts logo
Asreonn/godot-superpowers

godot-split-scripts

Use when Godot scripts exceed 150 lines or have multiple responsibilities. Detects scripts doing too many things (player movement + combat + inventory + UI). Automatically splits into focused scripts following Single Responsibility Principle, preserves behavior exactly, and creates git commits pe...

4 0
View
godot-convert-shaders logo
Asreonn/godot-superpowers

godot-convert-shaders

Converts Godot 3.x shader code to Godot 4.x shader syntax. Updates SCREEN_TEXTURE to screen_texture uniform, DEPTH_TEXTURE to depth_texture uniform, texture() function changes, built-in varyings updates, and light function signature changes. Essential for rendering and visual effect migrations.

4 0
View
godot-migrate-tilemap logo
Asreonn/godot-superpowers

godot-migrate-tilemap

Migrates legacy TileMap (Godot 4.0-4.2) to new TileMapLayer system (Godot 4.3+). Handles TileMap node conversion, API migration (set_cell to set_cells_terrain_connect), TileSet resource updates, physics layer mapping, navigation layer conversion, and custom data preservation. Essential for upgrad...

4 0
View
godot-setup-animationtree logo
Asreonn/godot-superpowers

godot-setup-animationtree

Use when setting up AnimationTree nodes for state machine-driven animation, creating AnimationNodeStateMachine graphs, configuring BlendSpace2D/3D for locomotion blending, implementing state transition conditions, or creating animation blend trees for complex animation mixing. Supports player cha...

4 0
View
godot-extract-resources logo
Asreonn/godot-superpowers

godot-extract-resources

Use when Godot code has hardcoded game data in const arrays, dictionaries, or embedded values. Detects inline data like enemy stats, item definitions, level configurations. Automatically extracts to .tres resource files, making data visible in editor, easily modifiable, and supports data-driven d...

4 0
View
godot-modernize-input logo
Asreonn/godot-superpowers

godot-modernize-input

Use when handling input in Godot 4.x projects and need to modernize patterns. Generates Input Map configurations from hardcoded key checks, sets up joypad rumble (Godot 4.x feature), implements gyroscope/accelerometer input on mobile, creates context-sensitive input handling for different game st...

4 0
View
godot-sync-parallax logo
Asreonn/godot-superpowers

godot-sync-parallax

Use when Godot ParallaxBackground/ParallaxLayer nodes show incorrect positions in editor due to parallax multipliers. Calculates correct editor positions based on camera start position and parallax motion scale. Makes parallax layers preview realistically in editor, matching gameplay appearance.

4 0
View
godot-setup-export logo
Asreonn/godot-superpowers

godot-setup-export

Use when setting up multi-platform exports for Godot projects, configuring export presets, icons, feature tags, build scripts, or CI/CD pipelines

4 0
View
godot-generate-tests logo
Asreonn/godot-superpowers

godot-generate-tests

Use when developing Godot games and need comprehensive test coverage for GDScript classes, signals, scene initialization, and integration flows. Generates GUT framework unit tests, integration tests, mock/stub helpers, and CI/CD test runner configuration.

4 0
View
godot-fix-positions logo
Asreonn/godot-superpowers

godot-fix-positions

Use when Godot project has position conflicts between editor (.tscn) and code (.gd), camera-following backgrounds, or runtime positions don't match editor preview. Orchestrates all 3 position sync mini-skills: sync-static-positions, sync-camera-positions, and sync-parallax. Each operation targets...

4 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View