hi , im trying to make jumping script follow this tutorial but its acting wried
heres my script
local module = {}
function module:Setting(target, velocity)
module.__index = module
self.Target = target
self.Position = target.Position
self.velocity = velocity
end
function module:Jump(dt)
local gravity = Vector3.new(0, 3, 0)
print(gravity)
self.Position = self.Position + self.velocity * dt
self.velocity = self.velocity + gravity * dt
warn(self.Position + self.velocity)
return self.Position, self.velocity
end
return module
server
local Part = workspace.Part;
local Jump = require(script:WaitForChild("jump"));
Jump:Setting(Part,Vector3.new())
game:GetService("RunService").Heartbeat:Connect(function(dt)
local pos,velo = Jump:Jump(dt)
Part.CFrame = CFrame.new(pos)
Part.Velocity = velo
end)
and this happened
https://streamable.com/1wziup