impact.procGraph
A round striking a hard surface: a flash, a spray of sparks thrown back off it that fall and cool, a burst of dust and grit that billows and settles, and a flicker of light on the surface.
impact
A round striking a hard surface: a flash, a spray of sparks thrown back off it that fall and cool, a burst of dust and grit that billows and settles, and a flicker of light on the surface.
Fire it where the round lands, with the effect's -Z turned along the normal of the surface it struck, and let it go when it ends:
-- `graph` is this graph's reference: the AssetRef `asset.resolve` or a search returns for it.
local function hitEffect(position, normal)
local e = entity.spawn("impact", { position = position, temporary = true })
e:lookAt({ position[1] + normal[1], position[2] + normal[2], position[3] + normal[3] })
e.component.add("Generator", { graph = graph, playOn = "load", ending = "hold" })
e.component.get("Generator").events.onFinished:connect(function()
e:despawn()
end)
return e
end
| Input | Default | What it does |
|---|---|---|
size | 1 | How big the strike is: 1 a rifle round on concrete, 3 a heavy round, 0.4 a pistol. |
light | 1 | Strength of the light it throws, as a multiple of the default. |
Set them with the Generator's params, e.g. params = { size = 3 }. It plays
66 frames at 60 fps (1.1 s). Every play with the same params plays the frames
the first one cooked.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2impact — a round striking a hard surface. A flash at the point of impact, a spray of sparks thrown back off the surface that fall and cool, a burst of dust and grit that billows out and settles, and a light that flickers on the surface for an instant. The surface's normal runs along -Z: play it at the hit point with `direction` the normal of the surface it struck.
scaled(name: string, points: any, dims: any) → any
Every layer is simulated at size 1, then its positions and sizes are multiplied by `size`.
| arg | type | description |
|---|---|---|
| name | string | |
| points | any | |
| dims | any |
drawn(name: string, points: any, shader: string, blend: string, properties: any?) → any
| arg | type | description |
|---|---|---|
| name | string | |
| points | any | |
| shader | string | |
| blend | string | |
| properties | any? |
{"cookMs":443,"gpuMs":0.2,"measuredOn":"native debug build, headless, on an empty stage in edit mode. `vramBytes` is the peak rise in renderer.gpuMemory() (compute, instances, meshes, textures) over an idle baseline while one play runs from an empty cook cache: its solvers, its instanced draws and the frames its cache holds. `cookMs` is that play's cook time over every frame (playback().cost.cookMs); a play fired while one holds the frames, or after, replays them. `gpuMs` is the peak rise in the frame's measured GPU time over the same baseline, whose own spread is about 0.2 ms, so it is the bound that instrument supports.","vramBytes":317000}descriptionA round striking a hard surface: a flash, a spray of sparks thrown back off it that fall and cool, a burst of dust that billows and settles, and a flicker of light, with the surface normal along -Z.familycombatkindeffectSub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.