Component attached to inventory items that marks them as throwable for desktop players and exposes tuning properties for throw behavior. It defines throw force, upward arc bias, delay before release, and viewmodel animation duration.
using Sandbox;
/// <summary>
/// Marks an item as throwable by desktop players and holds throw tuning values.
/// Place on the item root next to <see cref="InventoryItem"/>. VR players throw
/// physically via hand motion (see <see cref="GrabPoint"/>), which ignores this.
/// </summary>
public sealed class Throwable : Component
{
/// <summary>Speed (units/sec) of a desktop throw along the camera direction.</summary>
[Property] public float ThrowForce { get; set; } = 900f;
/// <summary>Upward bias added to the throw direction so throws arc. 0 = flat, 0.15 = gentle arc.</summary>
[Property] public float UpwardBoost { get; set; } = 0.15f;
/// <summary>Seconds after pressing attack before a release can launch the item; lets the charge viewmodel animation play.</summary>
[Property] public float ThrowDelay { get; set; } = 0.7f;
/// <summary>Seconds to keep the viewmodel visible after PlayAttack before the item is released into the world.</summary>
[Property] public float ThrowAnimDuration { get; set; } = 0.125f;
}