Skip to content

RigComponent ​

Inherits: Node3D

Inherited by: EntityRigComponent, InteractableRigComponent

Base runtime rig class shared by EntityRigComponent and InteractableRigComponent. Owns all VFX remote transforms, decal indicators, highlight, and transparency logic. Subclasses provide the mesh source and slot-specific remote setup.

Variables ​

booloutline_eligibletrue
boolis_transparentfalse
Node3Drig_ownernull
AnimationPlayeranimation_playernull
Decalhitbox_outline
Decaltarget_marker
Decalselection_marker
Array[Array]remote_transforms[[], [], [], [], [], [], [], []]
Array[RemoteTransform3D]active_remotes[]

Methods ​

voidinitialize_rig( owner_node: Node3D )
Node3Dget_attachment_point_node( location: VFXSelection.VfxLocation )
Array[MeshInstance3D]material_target_meshes( _target: int, _item: Object = null )
boolapply_vfx_material_effect( selection: VFXSelectionMaterial, timer: Timer = null )
boolcleanup_vfx_material_effect( selection: VFXSelectionMaterial )
voidcreate_remotes_for_slot_index( slot_index: RemoteSlotIndex, parent: Node3D, count: int )
voidcreate_remotes_for_slot_index_with_offset( slot_index: RemoteSlotIndex, parent: Node3D, count: int, offset: Vector3 )
RemoteTransform3Dfind_available_remote( slot_index: RemoteSlotIndex )
RemoteTransform3Dassign_remote_transform( effect_vfx: VFX, location: VFXSelection.VfxLocation )
Array[RemoteTransform3D]assign_remote_transforms_for_hands( right_hand_vfx: VFX, left_hand_vfx: VFX )
voidrelease_remote( remote: RemoteTransform3D )
voidanimate_transparency( target_alpha: float, duration: float = 3.5 )
voidshow_rig( duration: float = 3.5 )
voidhide_rig( duration: float = 3.5 )
voidapply_fog_of_war_state( in_fog: bool )
voidset_hitbox_color( color: Color )
voidset_combat_outline( in_combat: bool, combat_color: Color = Color.RED )
voidset_selection_state( is_current: bool, is_selected: bool, current_color: Color = Color.CYAN, selected_color: Color = Color.GREEN )
voidset_mesh_overlay( highlight_type: HighlightType )
voidset_target_highlight_with_color( target_color: Color )
voidclear_target_marker()
voidapply_selection_outline( selection_color: Color, power: float = 3.0, intensity: float = 0.5, threshold: float = 0.0 )
voidset_visual_layer( layer: int )

Enumerations ​

enum RemoteSlotIndex ​

The places on the model where a visual effect can attach (base, hands, head, chest, weapon, feet, overhead).

  • BASE = 0
  • LEFT_HAND = 1
  • RIGHT_HAND = 2
  • HEAD = 3
  • CHEST = 4
  • WEAPON = 5
  • FEET = 6
  • OVERHEAD = 7

enum HighlightType ​

The highlights of the mesh: default, hover, none or target selected.

  • DEFAULT = 0
  • HOVER = 1
  • NONE = 2
  • TARGET_SELECTED = 3

Constants ​

  • const DEFAULT_REMOTE_POOL_SIZE = 10 - How many remote transforms are made for each slot.

Variable descriptions ​

bool outline_eligible = true ​

True when the rig may get an outline (a target highlight).

bool is_transparent = false ​

True while the rig is faded out (in fog, or hidden).

Node3D rig_owner = null ​

Stored owner reference — Entity or InteractableObject

AnimationPlayer animation_player = null ​

Animation player reference (populated by subclass during initialize_rig)

Decal hitbox_outline ​

The decal under the entity that shows its hitbox.

Decal target_marker ​

The decal that marks the entity as the target.

Decal selection_marker ​

The decal that marks the entity as selected.

Array[Array] remote_transforms = [[], [], [], [], [], [], [], []] ​

The remote transforms of each slot, ready for a visual effect to use.

Array[RemoteTransform3D] active_remotes = [] ​

The remote transforms a visual effect uses now.

Method descriptions ​

void initialize_rig( owner_node: Node3D ) ​

Single entry point. Stores the owner, creates decals, defers remote setup. Subclasses call super then add their own model instantiation.

Node3D get_attachment_point_node( location: VFXSelection.VfxLocation ) ​

Return the Node3D that physically represents a VfxLocation attachment point.

Array[MeshInstance3D] material_target_meshes( _target: int, _item: Object = null ) ​

The meshes a material effect goes on (the base: all the rig's meshes; an entity's rig picks by the target)

bool apply_vfx_material_effect( selection: VFXSelectionMaterial, timer: Timer = null ) ​

Apply a material effect to the rig's meshes. Returns success.

bool cleanup_vfx_material_effect( selection: VFXSelectionMaterial ) ​

Clean up a previously applied material effect. Returns success.

void create_remotes_for_slot_index( slot_index: RemoteSlotIndex, parent: Node3D, count: int ) ​

Makes remote transforms for a slot on a parent node.

void create_remotes_for_slot_index_with_offset( slot_index: RemoteSlotIndex, parent: Node3D, count: int, offset: Vector3 ) ​

Makes remote transforms for a slot on a parent node, moved by an offset.

RemoteTransform3D find_available_remote( slot_index: RemoteSlotIndex ) ​

A remote transform of the slot that no effect uses, or null.

RemoteTransform3D assign_remote_transform( effect_vfx: VFX, location: VFXSelection.VfxLocation ) ​

Gives a visual effect a remote transform at a place on the model. Hands are made through assign_remote_transforms_for_hands.

Array[RemoteTransform3D] assign_remote_transforms_for_hands( right_hand_vfx: VFX, left_hand_vfx: VFX ) ​

Gives the effects of the right and the left hand a remote transform each.

void release_remote( remote: RemoteTransform3D ) ​

Gives a remote transform back when its effect ends.

void animate_transparency( target_alpha: float, duration: float = 3.5 ) ​

Fades the rig to a transparency (0 = visible, 1 = invisible) over some seconds.

void show_rig( duration: float = 3.5 ) ​

Fades the rig in.

void hide_rig( duration: float = 3.5 ) ​

Fades the rig out.

void apply_fog_of_war_state( in_fog: bool ) ​

Hides the rig when it is in fog, shows it when it is not.

void set_hitbox_color( color: Color ) ​

Sets the color of the hitbox and selection decals.

void set_combat_outline( in_combat: bool, combat_color: Color = Color.RED ) ​

Shows the outline of the entity in the combat color while it fights.

void set_selection_state( is_current: bool, is_selected: bool, current_color: Color = Color.CYAN, selected_color: Color = Color.GREEN ) ​

Shows whether the entity is the current or a selected party member, in the colors given.

void set_mesh_overlay( highlight_type: HighlightType ) ​

Sets the highlight of the mesh (default, hover, none or target selected).

void set_target_highlight_with_color( target_color: Color ) ​

Highlights the entity as the target, in a color.

void clear_target_marker() ​

Hides the target marker.

void apply_selection_outline( selection_color: Color, power: float = 3.0, intensity: float = 0.5, threshold: float = 0.0 ) ​

Draws an outline on the mesh: color, power, intensity and threshold.

void set_visual_layer( layer: int ) ​

Puts the meshes of the rig on a visual layer (1 to 20).