Advertisement
AlewAlow

system

Apr 13th, 2024
814
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  2.  
  3. local Matter = require(ReplicatedStorage.Shared.Libs.Matter)
  4. local Components = require(ReplicatedStorage.Shared.Components)
  5.  
  6. local function MoveTransforms(world, state)
  7.     for id, transform, velocity in world:query(Components.Transform, Components.Velocity):without(Components.NonShared) do
  8.         world:insert(id, transform:patch({
  9.             Position = transform.Position + velocity.Velocity * Matter.useDeltaTime()
  10.         }))
  11.     end
  12. end
  13.  
  14. return MoveTransforms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement