#Bullets are slowing down for some unknown reason?

1 messages · Page 1 of 1 (latest)

rapid glen
#

I'm coding an enemy that shoots bullets at the player and for some reason the bullets just slow down when near the player? i have no idea as to why its happening. Im using body velocity to move the bullets idk why this is happening please help

while task.wait(1) do
    local clone = script.Parent.Parent.Projectile:Clone()
    clone.WeldConstraint:Destroy()
    clone.Transparency = 0
    clone.Parent = game.Workspace
    clone:SetNetworkOwner(nil)
    clone.Position = script.Parent.Parent.Projectile.Position
    local bodyvelocity = Instance.new("BodyVelocity")
    bodyvelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
    bodyvelocity.Velocity = script.Parent.CFrame.LookVector * 50
    bodyvelocity.Parent = clone
    game.Debris:AddItem(clone, 5)
    clone.CanTouch = true
end

also it only happens every once in a while????

modest mirage
#

It could be that there is too many physics objects that are being made at once

#

Roblox handles it's physics by applying the network ownership to player's as to not overload the server

#

clone:SetNetworkOwner(nil)So roblox doesn't overload the server or client, physics will start throttling and appear to slow down/lag when there are too many physics objects at once

modest mirage
#

This will not fix the issue but check to see how much of physics is being throttled

forest steeple
#
while task.wait(1) do
    local clone = script.Parent.Parent.Projectile:Clone()
    clone:SetNetworkOwner(nil)
    clone.WeldConstraint:Destroy()
    clone.Transparency = 0
    clone.Parent = game.Workspace
    clone:SetNetworkOwner(nil)
    clone.Position = script.Parent.Parent.Projectile.Position
    local bodyvelocity = Instance.new("BodyVelocity")
    bodyvelocity.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
    bodyvelocity.Velocity = script.Parent.CFrame.LookVector * 50
    bodyvelocity.Parent = clone
    game.Debris:AddItem(clone, 5)
    clone.CanTouch = true
end
#

heres your

#

correcteds

#

crit0esdrfpsdf