Loadout: Guns, Bows, Blades and Spells Kit
README.md
vfx
The weapon-specific visuals juiceKit does not draw: muzzle and cast flashes, bullet tracers, continuous beams (laser, lightning, flame, chain), projectile trails, glowing spell/energy orbs and a few impacts (frost, splash, foam, slash, energy). The weapons code calls it next to Juice.play("vfxSparks" | "vfxFire" | "vfxZap" | "vfxExplosion…"), which still draws the generic impacts.
local Vfx = require("weaponsKit.vfx")
Vfx.flash("gun", muzzlePos, aimDir, { look = "realistic" }) -- gun shotgun energy fireCast iceCast stormCast toy swing throw
Vfx.tracer(muzzlePos, hitPos, { look = "scifi", speed = 350 })
local beam = Vfx.beam({ kind = "laser", look = "scifi" }) -- laser lightning flame chain
beam:set(from, to) -- every frame; beam:stop() when done (auto-stops after 1 s without :set)
local trail = Vfx.trail(rocket, { kind = "smoke" }) -- smoke fire ice magic arrow foam water
local orb = Vfx.orb("fireball", { look = "fantasy" }) -- fireball iceShard plasma energyBolt; caller moves + despawns it
Vfx.burst("frost", hitPos, hitNormal) -- frost splash foam slash energy
Vfx.kinds() Vfx.kinds("beam") Vfx.looks() Vfx.stats() Vfx.stopAll()
Looks: realistic (default), scifi, fantasy, cartoon. An unknown kind or look never raises: it warns once and answers false, a no-op handle, or (for orb) an empty entity.
Everything is local to the peer that calls it (networking is the caller's job). Particles are drawn the juiceKit way: one instanced draw per material × mesh (juiceKit's juiceGlow / juiceSmoke / juiceSolid materials), fed from two GPU buffers, no entity per particle. A flash is 4–18 particles, a burst 6–28, a tracer 1–3 instances, a beam 3–40 instances per frame, a flame stream ~25 live particles. The frame loop stops itself when nothing is alive. stats().live counts live particles, tracers, beams, trails and orbs; pooled the instanced draws held for reuse. Only orb spawns entities (a root plus one unlit mesh child); the caller owns and despawns them.