search/
Start typing to search packages!
package_2
jecs-assemblies
By @pepeeltoro41
Roblox
MirroredJecs Assemblies
Utility for calculating cframe offset chains for Jecs.
Setup
-
Replace
transform,relative, andpivotwith your own components. This is optional, and components will be created if they don't exist when callingjecs_assemblies.world. -
Call
jecs_assemblies.world(world)before using it to set it up with your world. -
Add
jecs_assemblies.system()to your systems. Set the order right before your transform cframes apply.
local c = require(components)
local jecs_assemblies = require(jecs_assemblies)
jecs_assemblies.transform = c.transform
jecs_assemblies.world(world)
return {
system = function()
jecs_assemblies.system()
end
}
Usage
- Use
jecs_assemblies.pivotas a pair to reference a parent entity. - Use
jecs_assemblies.relativeto set a relative CFrame to the parent. - Transforms will be applied to
jecs_assemblies.transform. The very first parent will use the value ofjecs_assemblies.transform. - You can chain multiple pivots to get a final transform.
local c = require(components)
local ja = require(jecs_assemblies)
local character = world:entity()
local camera = world:entity()
world:set(character, c.transform, cf)
world:add(camera, pair(ja.pivot, character))
world:set(camera, c.relative, rel)
-- camera transform = character transform * camera rel
Swapping pivots
- use
jecs_assemblies.swap_pivotto swap the pivot of an entity. This will change your pivot while keeping the world space transform by calculating the relative cframe from the current entity transform and the new pivot transform. This function will also remove any previous pivots.
Package Details
Install command (Click to copy)
Version
1.0.2
License
MIT
Safe for commercial use
License identified from the packaged LICENSE file; the manifest declared none.
Automated license review — not legal advice.
