So i had a issue where my projectile will be a little off where my mouse was but i solved it. But now my projectile curves for some reason?
local script code in tool:
local Tool = script.Parent
local Folder = game.ReplicatedStorage:WaitForChild("Pistol")
local Bullet = Folder.Bullet
local Cooldown = false
local DebrisService = game:GetService("Debris")
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
Tool.Activated:Connect(function()
if Cooldown == true then
return true
else
Cooldown = true
local NewBullet = Bullet:Clone()
NewBullet.Parent = Tool
NewBullet.Position = Tool.Handle.Position
local Velocity = Instance.new("BodyVelocity")
Velocity.Parent = NewBullet
Velocity.Velocity = (Mouse.Hit.Position - Tool.Handle.Position).Unit * 1000
DebrisService:AddItem(NewBullet, 10)
task.wait(1)
Cooldown = false
end
end)
Example:
robloxapp-20240626-2144213.wmv (442.5 KB)
if anyone knows how to fix this i would be greatful and can anyone explain a little about body velocity as im still learning