Lumiere - A projectile management library for parallel Luau

Logo

Lumiere

A projectile management library for parallel Luau

Documentation →

Lumiere is, as the tagline entails, a library made to help you program projectiles in parallel. It supplies you with a set of utilities and abstractions to make implementation as straightforward as possible.

Enough said, here’s a quick example:

-- actorTemplate/runtime.client.luau
-- imports omitted for clarity

local bullet = useBullet(actor)
local mutator = createMutator(bullet)

useLifecycleEvent(RunService.PostSimulation):withFixedFramerate(15):connectParallel(function(deltaTime)
	mutator:incrementPosition(mutator.nextDirection * deltaTime)

	local raycastResult = mutator:raycastForward()
	if raycastResult ~= nil then
		print(`bullet hit {raycastResult.Instance.Name}`)
	end

	mutator:flushMutations()
end)
-- test.client.luau
-- imports omitted for clarity

local source = createSource(script.bullets, script.actorTemplate)

local origin = Vector3.new(0, 15, 0)
local direction = Vector3.new(0, -15, 0)
source:makeBullet(origin, direction)

This will spawn a bullet at 0, 15, 0 going downwards at a constant speed of 15 studs per second, updating at 15 frames per second. It’ll log all parts it touches. You can learn more about Lumiere in the documentation.

7 Likes

0.1.3

You can now pass information down to bullets via the information parameter of Source:makeBullet:

-- test.client.luau
-- imports omitted for clarity

local source = createSource(container, actorTemplate)

local origin = Vector3.new(0, 15, 0)
local direction = Vector3.new(0, -15, 0)
source:makeBullet(origin, direction, { message = "hello, world!" })
-- actorTemplate/runtime.client.luau
-- imports omitted for clarity

local bullet = useBullet(actor)
print(bullet.information.message) -- hello, world!

note: information must be a boolean, number, string, SharedTable, or a serializable data type like Vector3.