Addon ID

  • directional_sprite_3d

Info

Statistics

  • Download count21 total downloads
  • Latest download count 21 downloads of latest version
  • Average download count1 downloads per day average

Owners

Auto Directional 3D Billboard Behavior Documentation

if you want buy me a coffe! buymeacoffee.com/fallout2remake

Overview

Auto Directional 3D Billboard is a Construct 3 behavior that automatically calculates and manages directional sprite animation for NPCs, recreating the classic billboard sprite system found in games like Daggerfall and Fallout 1/2. The behavior computes the correct facing direction every tick based on the player's position relative to the NPC's movement angle, then assembles a ready-to-use animation name so your characters always display the correct side to the camera.

Properties

Enabled — Activates or deactivates the behavior on this object. Can be toggled at runtime via the Set Enabled action.

Player name — The name of the player object as it appears in the Construct 3 project panel. The behavior uses this to locate the target every time the layout starts.

Prefix — A per-NPC animation name prefix set directly in the editor, such as Man, Woman, or Tribal. Combined with State and Direction to form the full animation name.

Auto state — When checked, the behavior automatically switches between Idle and Walk states by detecting whether the NPC moved more than the Speed threshold in the last tick.

Speed threshold — The minimum distance in pixels the NPC must travel per tick to be considered walking. Only used when Auto state is enabled. Default is 0.5.

Actions

Set enabled — Enables or disables the behavior at runtime.

Set target name — Overrides the Player name property at runtime by providing the target object's name as a string.

Set facing angle — Sets the NPC's current facing direction in degrees. Call every tick with the movement angle from your movement behavior, for example Self.Bullet.AngleOfMotion.

Set prefix — Overrides the Prefix property at runtime. Useful when swapping character skins or types dynamically.

Set state — Sets the current animation state string, for example Idle, Walk, Attack, or Pickup. Ignored on the current tick if Auto state is enabled and the NPC is moving.

Conditions

Is enabled — True when the behavior is currently active.

On direction changed — Triggers whenever the direction index changes. Use this to update animations reactively instead of polling every tick.

Expressions

DirectionIndex — Returns the current direction as a number: 0 = Front, 1 = Right, 2 = Back, 3 = Left.

AngleToTarget — Returns the raw angle in degrees from the NPC to the target, calculated the same way as Construct 3's built-in angle() expression.

AnimationName — Returns the fully assembled animation name as a string in the format Prefix + State + Direction, for example ManWalkFront or TribalAttackRight. Pass this directly to the Set Animation action.

Recommended event setup

On start of layout

→ NPC: Set target name "Player"

Every tick

→ NPC: Set facing angle to Self.Bullet.AngleOfMotion

→ NPC: Set animation to NPC.AutoDirectional3DBillboard.AnimationName

(do not restart if already playing)

Animation naming convention

For the behavior to work correctly, all directional animations must follow a consistent naming pattern:

[Prefix][State][Direction]

Example for a character with prefix Man:

ManIdleFront, ManIdleRight, ManIdleBack, ManIdleLeft

ManWalkFront, ManWalkRight, ManWalkBack, ManWalkLeft

ManAttackFront, ManAttackRight, ManAttackBack, ManAttackLeft