Skip to content

SusFloatingDamage

SusFloatingDamage

Ephemeral floating number (−damage / +heal) that animates up and self-removes after ~1.2s.

Package

SusKit · World (commercial)

Open in Playground

SusKit · World

Props

NameTypeDefault
DamageProp<int>0
IsCriticalProp<bool>false
IsHealProp<bool>false

Slots

No slots.

Events

No public events.

Style hooks

USS class contract — override appearance without touching C#. States toggle via these classes:

  • fd-label
  • sus-floating-damage
  • sus-floating-damage--crit
  • sus-floating-damage--default
  • sus-floating-damage--heal

Usage

Spawn a fresh instance per hit — the element removes itself when the animation ends.

csharp
var dmg = new SusFloatingDamage();
dmg.Damage.Value = 128;
dmg.IsCritical.Value = true;
dmg.IsHeal.Value = false;
host.Add(dmg);
xml
<template>
  <sus:SusFloatingDamage :Damage="Amount.Value"
                         :IsCritical="Critical.Value"
                         :IsHeal="Heal.Value" />
</template>

<script>
public Prop<int> Amount = new(128);
public Prop<bool> Critical = new(true);
public Prop<bool> Heal = new(false);
</script>
PropRole
DamageAbsolute amount shown (0 skips paint)
IsCriticalCrit styling (ignored when heal)
IsHeal+ prefix + heal class

Notes

  • Label text is -N (damage) or +N (heal); magnitude from Math.Abs(Damage).
  • After the animation the element calls RemoveFromHierarchy — recreate for the next hit (Storybook uses loop + Replay).
  • Pair with world-space hosts / markers when floating over a unit.