A small component class used in the FPS UI to mark a hitbox region on a target. It stores a DamageMultiplier and a Region label; intended to be attached to a bone or child GameObject that has a Collider so hitscan code can apply damage multipliers and show a label.
using Sandbox;
namespace Goo.FpsUI;
// Marks a body region on a target for the hitscan. Attach to a bone GameObject (or any child of an FpsTarget)
// that ALSO has a Collider; when the ray lands on that collider the HUD scales hitscan damage by
// DamageMultiplier. Damage still flows to the FpsTarget on an ancestor - this is a multiplier + label, not a
// health pool, so one target keeps a single health bar while different bones hit for different amounts.
[Title( "FPS Hitbox" ), Category( "FPS UI" ), Icon( "adjust" )]
public sealed class FpsHitbox : Component
{
[Property, Range( 0.1f, 10f )] public float DamageMultiplier { get; set; } = 2f; // head = 2x, limbs < 1, etc.
[Property] public string Region { get; set; } = "Headshot"; // XP-feed label on a kill landed here
}