So i have created a script that would shoot when you press q but when i press q the bullet just spawns and does nothing. I want so my bullet would go in the direction where the gun is pointing at
--
local remote = game.ReplicatedStorage.Block1
local block = game.ReplicatedStorage.Block.Handle
remote.OnServerEvent:Connect(function(player,mouse)
local shootingPart =player.Character:FindFirstChild('Block').Handle
local bullet = block:Clone()
bullet.Position = shootingPart.Position
bullet.Parent =game.Workspace
local bodyVelocity = Instance.new("LinearVelocity")
bodyVelocity.MaxForce = 10000000
bodyVelocity.VectorVelocity = shootingPart.CFrame.LookVector * 100
end)
Check to make sure the block (bullet) is unanchored and refer to the documentation of LinearVelocity to check if all your properties are set properly for VectorVelocity to work. If an attachment is needed, add one and connect it.