ItemShot
CustomFlag: ItemShot
Description When the firearm is shot it will spawn/launch an item or projectile according to these settings. Useful for thrown-projectile behavior, grenades, or items that are themselves projectiles spawned by weapons or other systems.
Parameters
is_grenade—bool— Iftrue, the projectile is treated as a grenade (explosive behavior may be handled elsewhere). Default:false.grenade_explode_on_impact—bool— Iftruethe grenade will explode on impact instead of on a timer. Default:false.is_custom_item—bool— Iftrue, the launched object is a custom item (usecustom_item_id). Iffalse, a built-initem_typeis used. Default:false.velocity—float— Initial forward velocity of the launched projectile (units depend on game physics). Default:0.upwards_factor—float— Upward / vertical component multiplier applied to the launch. Default:0.torque—Vector3— Angular torque applied to the launched object (affects spin). Default:Vector3(0,0,0).custom_item_id—uint— ID of the custom item to spawn ifis_custom_itemistrue. Default:0.item_type—ItemType— Built-in item type to spawn ifis_custom_itemisfalse. (Use your project’sItemTypeenum; no default provided in class.)
Behavior notes
If
is_custom_itemistrue, thecustom_item_idfield must reference a valid custom item ID. Iffalse, the engine will useitem_type.IsGrenadetypically affects collision/explosion logic; ensure your grenade handling code checksgrenade_explode_on_impactaccordingly.Velocity,UpwardsFactor, andTorquecontrol physics. Tune them for desired projectile arc and spin.
Example Yaml context
flag_settings:
item_shot_settings:
- is_grenade: true
grenade_explode_on_impact: true
is_custom_item: false
velocity: 25.0
upwards_factor: 0.2
torque:
x: 0
y: 1
z: 0
custom_item_id: 0
item_type: HEGrenadeLast updated
Was this helpful?