Hello.
I’m making currently gun.
But I have problem with bolt , When I player click to fire the bullet will stop after 3 seconds move.
I know this is because anchored but I clearly setting the bolt unanchored.
This is script:
script.Parent.ShootEvent.OnServerEvent:Connect(function(plr,BoltDirection)
local Bolt = plr.Character.Gun.Bolt:Clone()
Bolt.Parent = workspace
Bolt.Anchored = false
Bolt.CFrame = BoltDirection
Bolt.Transparency = 0
local Velocity = Instance.new("BodyVelocity",Bolt)
Velocity.MaxForce = Vector3.new(5000000,5000000,500000)
Velocity.Velocity = BoltDirection.LookVector * 150
Bolt.Touched:Connect(function(hit)
if hit and hit.Parent and hit.Parent.Name ~= "Workspace" then
print(hit.Parent.Name)
local _BoltForKnows = plr.Character.Gun.Bolt:Clone()
_BoltForKnows.Transparency = 0
_BoltForKnows.Parent = workspace
_BoltForKnows.Position = Bolt.Position
_BoltForKnows.Size = Vector3.new(1,1,1)
_BoltForKnows.Anchored = true
end
end)
end)
Thanks for help