How would I change my script to make a projectile fire from the cursor?

  1. What do you want to achieve? Keep it simple and clear!
    I want to make my projectile shoot from the mouse cursor instead of from a part on my humanoid.
  2. What is the issue? Include screenshots / videos if possible!

script.Parent.Fire.OnServerEvent:Connect(function(plr, mousePos)
local firepart = plr.Character:FindFirstChild(‘SpellFirePoint’)

if firepart ~= nil then
	local bv ='BodyVelocity')
	bv.MaxForce =,30000,30000)
	bv.Velocity = firepart.CFrame.lookVector * boogerSpeed
	local boogerClone = booger:Clone()
	boogerClone.Parent = workspace
	boogerClone.CFrame = firepart.CFrame
	boogerClone.CFrame =, mousePos)
	bv.Parent = boogerClone
	game.Debris:AddItem(boogerClone, boogerLifetime)
		if hit.Parent.Name == plr.Name then return end
		if hit.Parent:FindFirstChild('Humanoid') then
			hit.Parent.Humanoid.WalkSpeed *= 0.5 
			hit.Parent.Humanoid.Health -= boogerDamage
			hit.Parent.Humanoid.WalkSpeed *= 2


  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Yeah, but I couldn’t find any that helped me with my situation. It’s probably an easy fix, but I can’t figure it out.

Can you explain further?
What do you mean from the cursor?

Do you mean from the workspace.currentcamera or from the place at which the mouse hits.?

I mean from the place at which the mouse hits using mouse.hit.p