DecayKnowledgebase
functiongenerated

Physics.create_spring_joint

Authors an enabled spring on an existing owner with no authored 2D joint of any kind. Finite Vec2 anchors use body-local world units without transform scale; rest length must be finite and positive, stiffness/damping finite and non-negative. Scoped handles become stable IDs or local prefab paths; null leaves an endpoint unbound and inactive targets suspend until active. Requires physics, works before bodies are built and creates its constraint at next fixed synchronization. Invalid arguments or existing joints fail before mutation. Keeps other owner components and body motion; legacy connections remain separate. Existing set_spring controls can retune the new joint before synchronization.

Signature

Physics.create_spring_joint(joint: Entity, first: Entity, second: Entity, first_anchor: Vec2, second_anchor: Vec2, rest_length: number, stiffness: number, damping: number) -> unit

Member of Physics

Related types

Entity

Source
docs/generated/decay-api.json
Schema
v1
Engine version
0.1.0
Source commit
909aca81368b