I have a test gun and I guess you can call it a bullet but when I shoot the bullet it doesn’t go in the direction of where the gun is pointing, sometimes it will but then sometimes it’ll go right of the gun or left
here is my script, its a server script that’s placed in the gun
I tried comparing the properties of my vectorforce and by making a new once inside a random part but cant figure out why its not moving in the direction of my gun
as you see here the “bullet” flies right
local ServerStorage = game:GetService("ServerStorage")
local PinkSlime = ServerStorage.Slimes.PinkSlime
local SlimeGrabber = script.Parent
local Handle = SlimeGrabber.Handle
local Player = SlimeGrabber.Parent.Parent
local Hrp = Player.Character.HumanoidRootPart
local Hum = Player.Character.Humanoid
local PlayerFolder = Player:WaitForChild("PlayerFolder")
local SlimeGrabMode = PlayerFolder:WaitForChild("SlimeGrabMode")
local CoolDown = false
-- false (throws)
-- true (Grabs)
SlimeGrabber.Activated:Connect(function()
if (CoolDown == false) then
CoolDown = true
if SlimeGrabMode.Value == false then
local CreateSlime = PinkSlime:Clone()
CreateSlime.CFrame = Handle.CFrame
CreateSlime.Parent = workspace
local Attachment0 = Instance.new("Attachment")
Attachment0.Parent = CreateSlime
local VectorForce = Instance.new("VectorForce")
VectorForce.Force = Hrp.CFrame.LookVector * 1500
VectorForce.ApplyAtCenterOfMass = false
VectorForce.Attachment0 = Attachment0
VectorForce.Parent = CreateSlime
task.wait(0.2)
Attachment0:Destroy()
VectorForce:Destroy()
end
task.wait(0.3)
CoolDown = false
end
end)