This skill helps you create a ribbon trail that follows weapon movement in React Three Fiber by using a ring buffer and gradient textures.
npx playbooks add skill verekia/r3f-gamedev --skill weapon-trail
Create a ribbon trail effect that follows a weapon's movement.
Build a custom BufferGeometry that stores a history of positions in a ring buffer. Each frame, record the current world positions of trail points and update the geometry vertices to create a ribbon connecting all historical positions.
positions.needsUpdate = truelocalToWorld() to get world positions from the target objectconst trailPoints = [new Vector3(0, 0, 0), new Vector3(0, 1.5, 0)]
<group ref={weaponRef}>
<mesh>{/* weapon mesh */}</mesh>
</group>
<Trail target={weaponRef} points={trailPoints} enabled={isAttacking} />
---
This skill is part of [verekia](https://x.com/verekia)'s [r3f-gamedev](https://github.com/verekia/r3f-gamedev).
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.