How can I make the projectile accurately go towards where the mouse position is at

local mouse = plr:GetMouse()
local hitTargetPos = mouse.Hit -- get mouse position

---
m1Hitbox.CFrame = humRP.CFrame * CFrame.new(0, 0.5, -1)
m1Hitbox.Parent = char
game.Debris:AddItem(m1Hitbox,1)
local bodyVel = Instance.new("BodyVelocity")
bodyVel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
bodyVel.Velocity = hitTargetPos.LookVector * 100 -- speed
		

the circle red part is the hitbox, I want it to go directly where the mouse cursor is at.

I’d suggest raycasting to get the world position :slight_smile:

1 Like

raycasting fixed my problem, thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.