When I create a projectile I position its CFrame to be at the tip of the staffs CFrame which I know is the problem because when I shoot the projectile, it goes in the direction of the mouse UnitRay and the tip is not always rotated in that direction. What would be the best way to fix this problem?
local tip = script.Parent.Tip
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local cast = game:GetService("ReplicatedStorage"):WaitForChild("Cast")
cast.OnClientEvent:Connect(function()
local p = Instance.new("Part")
p.Parent = workspace
p.Anchored = false
p.BrickColor = BrickColor.new("Really red")
p.Size = Vector3.new(1,1,3)
p.CanCollide = false
p.CFrame = tip.CFrame
game.Debris:AddItem(p, 5)
local bv = Instance.new("BodyVelocity")
bv.Parent = p
bv.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
bv.Velocity = mouse.UnitRay.Direction * 100
end)

5 comments
Yes but then that make the projectile always go in the direction the tip is facing and not were the mouse was pressed
Well then what's the problem with your current code?
I want the projectile to face the way the it is moving. When I use the UnitRay it goes in the right direction, but it is sometimes rotated sideways
Can't you do CFrame.LookVector = mouse.UnitRay.Direction ?
Try using some of the direction properties here https://developer.roblox.com/en-us/api-reference/datatype/CFrame and see which one works best for your situation.