I know the title is a bit weird but basically when the player shoots out of the gauntlets (pretty much like a dart shooter) the dark moves weirdly and wobbles around if the player is moving. Is there any way I can stop this from happening?
video:
script if it helps: (indent thing is weird, dont mind it)
local dart = game:GetService("ServerStorage").Dart
local dartSpeed = 50
local dartLifetime = 5
local dartDamage = 10
local cooldown = 0.3
local canshoot = true
script.Parent.Fire.OnServerEvent:Connect(function(player)
if not canshoot then return end
canshoot = false
local root = player.Character.HumanoidRootPart
local bv = Instance.new("BodyVelocity")
bv.MaxForce = Vector3.new(1,1,1)*30000
bv.Velocity = root.CFrame.lookVector * dartSpeed
local d = dart:Clone()
d.Parent = game.Workspace
d.CFrame = root.CFrame
bv.Parent = d
game.Debris:AddItem(d,dartLifetime)
d.Touched:Connect(function(hit)
if hit.Parent.Name == player.Name then return end
if hit.Parent:FindFirstChild("Humanoid") then
hit.Parent.Humanoid.Health -= dartDamage
d:Destroy()
end
end)
wait(cooldown)
canshoot = true
end)