·
procgraph · drop-in viewer
asset⌬ procgraphprocGraphprimary: init.luau·part ofpackage effectShowcase.package·originates fromworld 0fc7535e-6…
tracer.procGraph
The glowing streak of a round in flight: a white-hot streak leaving the muzzle along -Z and burning out `distance` metres on, shedding embers that fall and cool behind it.
by·posted 11d ago
What it does
tracer
The glowing streak of a round in flight: a white-hot streak leaving the muzzle
along -Z and burning out distance metres on, shedding embers that fall and
cool behind it.
Fire it at the muzzle with its -Z turned toward what the round hits, and
distance the range to it:
-- `graph` is this graph's reference: the AssetRef `asset.resolve` or a search returns for it.
local function tracer(from, to)
local dx, dy, dz = to[1] - from[1], to[2] - from[2], to[3] - from[3]
local e = entity.spawn("tracer", { position = from, temporary = true })
e:lookAt(to)
e.component.add("Generator", {
graph = graph, playOn = "load", ending = "hold",
params = { distance = math.sqrt(dx * dx + dy * dy + dz * dz) },
})
e.component.get("Generator").events.onFinished:connect(function()
e:despawn()
end)
return e
end
| Input | Default | What it does |
|---|---|---|
distance | 40 | How far the round flies before it burns out, in metres: the range to what it hits. |
speed | 240 | How fast it flies, in metres per second. |
width | 0.04 | Width of the streak, in metres. |
The streak runs back from the round for as far as it flies in a sixtieth of a
second, and never behind the muzzle. It plays 45 frames at 60 fps (0.75 s).
Each distance is its own set of frames: plays at one range share what the
first one cooked.
Discussion
Scoped to this part · feeds back into the world's score.
Sign in to post.sign in
No comments yet. Be the first.