Skip to content

VFXEnchant ​

Inherits: VFXLoop < VFX < Node3D

An ENCHANT on a weapon (2026-11-14). It is made along a straight blade: +Y from its origin, authored_length long, reaching authored_width from the line. When it plays it is FITTED to the enchant segment of the weapon it is on (the start, end and width set on the mesh in Entity Assets > Equipment Meshes, the Enchant tool), so one effect suits a dagger, a sword, a polearm and, with start and end together (a SPOT), a hammer head: the effect then gathers round the point.

Description ​

The ROLE of each child (its metadata "enchant_role") says how it is fitted: stretch stretched along the segment and widened to its width (a sheath, an edge glow, a ribbon). Its default for meshes and holders. fill kept round (not stretched); the emission box of its particles is made as long and as wide as the segment (motes, flames, smoke along the blade). Its default for particles. section kept round, placed along the segment where it was along the blade (a rune at the middle; a ring that slides up and down keeps sliding, its animation is in the blade's frame). Its default for lights. ends kept round, placed at the start or the end of the segment, whichever it was made nearer (a glow at the tip, a flare at the guard). A node that is kept round is scaled by the width (a thin dagger gets smaller motes), within 0.5 to 2 times. Animations may move the children; they must not turn or scale the kept-round ones (their basis is set by the fit).

It follows the weapon NODE it is on (a weapon slot of the skeleton), refits when the mesh in that slot changes, and hides while the slot is empty (a sheathed or unequipped weapon).

Properties ​

floatauthored_length1.1
floatauthored_width0.06
floatspot_size2.0
Vector2round_scale_rangeVector2(0.5, 2.0)

Variables ​

Vector3segment_startVector3.ZERO
Vector3segment_endVector3(0, 1.1, 0)
floatsegment_width0.06
Transform3Dfit_transformTransform3D.IDENTITY
Node3Dweapon_nodenull
HandhandHand.ITEM
Objectitemnull
Dictionarysegment_override{}

Methods ​

voidactivate_vfx( selection: VFXSelection = null )
voidattach_to_weapon_of( entity: Node )
voidset_item( enchanted_item: Object )
voidattach_to_node( node: Node3D )
voidpreview_on( node: Node3D, start: Vector3, end: Vector3, width: float )
voidstop_preview()
voidfit( start: Vector3, end: Vector3, width: float )
Stringrole_of( node: Node ) static

Enumerations ​

enum Hand ​

Which weapon it goes on.

  • ITEM = 0 - The weapon the enchanted item is (the hand its equipment slot puts it in); the main hand when that is not known.
  • MAIN_HAND = 1 - The weapon in the main hand.
  • OFF_HAND = 2 - The weapon in the off hand.

Constants ​

  • String ROLE_META = "enchant_role" - The metadata that names the role of a child.
  • Array[String] ROLES = ["stretch", "fill", "section", "ends"] - The roles a child can have.

Property descriptions ​

Enchant

float authored_length = 1.1 ​

How long the blade the effect was made along is (from its origin up +Y).

float authored_width = 0.06 ​

How far from the blade's line the effect was made to reach.

float spot_size = 2.0 ​

A segment shorter than this many times its width is a SPOT: the effect gathers into a ball of that length round the middle.

Vector2 round_scale_range = Vector2(0.5, 2.0) ​

How much the kept-round parts may grow or shrink with the width.

Variable descriptions ​

Vector3 segment_start = Vector3.ZERO ​

The segment it is fitted to (in the weapon mesh's space).

Vector3 segment_end = Vector3(0, 1.1, 0) ​

No description yet.

float segment_width = 0.06 ​

No description yet.

Transform3D fit_transform = Transform3D.IDENTITY ​

The fit: from the blade the effect was made along to the segment (in the weapon's space). The effect is put at weapon * fit_transform.

Node3D weapon_node = null ​

The weapon node it follows (null: it stays where it is, as in a preview).

Hand hand = Hand.ITEM ​

The hand it goes on (from the selection that plays it).

Object item = null ​

The enchanted item (the owner of the effect), to find its hand.

Dictionary segment_override = ​

A segment to fit to instead of the one on the weapon's mesh (the editor's preview).

Method descriptions ​

void activate_vfx( selection: VFXSelection = null ) ​

Loop VFX should NOT auto-cleanup by default (manual control) (from VFXLoop)

void attach_to_weapon_of( entity: Node ) ​

Put it on the weapon of an entity (the hand says which); it is found again when the weapon changes.

void set_item( enchanted_item: Object ) ​

The enchanted item: the hand of its slot is the hand the effect goes on (with Hand ITEM). The weapon is looked for again.

void attach_to_node( node: Node3D ) ​

Put it on a weapon node directly (a weapon held by something that is not an entity).

void preview_on( node: Node3D, start: Vector3, end: Vector3, width: float ) ​

SHOW it on a weapon node in the editor (the Enchant tool of Equipment Meshes) without playing it as the game does: it follows the node, fitted to the segment given (the values of the tool, not saved on the mesh yet). Call again when they change.

void stop_preview() ​

Stops a preview: the effect lets go of the weapon and stands as it was made (a blade of authored_length from where it stands)

void fit( start: Vector3, end: Vector3, width: float ) ​

FIT the effect to a segment (in the weapon's space): the root gets the stretch, the kept-round children get it taken back.

String role_of( node: Node ) ​

The role of a child: its metadata, or the default for its kind.