whenever I want to update a bullet object via the update function is seems to stop updating all the other bullets and combine the changes from all the other bullets into one bullet
an example of what I mean
notice how some bullets stop and the more recent of them speed up
--how a chose what object to update
local bulletArray = {}
for i,v in pairs(bulletArray ) do
v:update(deltaTime)
end
--NEW SCRIPT
--the bullet module script
local bullet = {}
bullet.__index = bullet
function bullet.new(camera)
local bulletMeta = setmetatable({}, bullet)
bullet.instance = game:GetService("ReplicatedStorage"):WaitForChild("GunModels"):WaitForChild("Bullets"):WaitForChild("bullet"):Clone()
bullet.instance.Parent = game.Workspace.Bullets
bullet.instance.CFrame = camera.CFrame
return bullet
end
function bullet:update(deltaTime)
self.instance.CFrame *= CFrame.new(0,0,-10*(deltaTime*16.666))
self.instance.CFrame *= CFrame.Angles(-0.0025*(deltaTime*16.666),0,0)
end
return bullet
I have check the array containing bullets and no object seem to be getting removed
any help appreciated