Part is being anchored unless I set it to unanchored

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

As a suggestion, you might want to switch to Raycasting and tweening - this is to prevent exploiters being able to use Infinite Yield and grab your bullets mid air as well as creating smooth bullets which don’t lag the physics engine.

Its also the more supported method for creating bullets.

1 Like

Yeah I thinked about it and I think it will be better than bullet
Thanks for tip, Have a nice day :slight_smile:

You need to make an anchored/unanchored statement in the script. It doesn’t necessarily have to have anchored properties you just needed to put an anchored statement. I think that you just have to go to the normal bolt property and review what is contained.