Skip to content

start_position on a spawned instance returns the spawner's position, not the instance's spawn point #54

Description

@dsrw

In a clone created via Proto.new(position = ...), start_position resolves to the spawner unit's position rather than the point the instance was spawned at. A script that tethers behavior to its spawn point (e.g. "fly back if too far from home") sends every instance to the spawner instead — nine flyers spawned around a city all converged on the spawner unit at ground level.

Root cause: Build.clone (src/models/builds.nim:579) seeds the clone with transform = clone_to.transform (or the spawner's draw_transform), and Build.init copies that into start_transform. The position passed to .new() is applied to the live transform afterward, but start_transform is never updated, so the start_position accessor (host_bridge.nim:472) reports the spawner's pose.

Workaround (documented in /build-script): pass the tether coordinates as explicit proto params mirroring each instance's spawn position.

Likely fix: set the clone's start_transform from its actual spawn transform once .new()'s position/rotation are applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions