You can get the direction from 2 positions/vectors using Vector2 - Vector1, and then normalizing it using unit: (Vector3.new(end) - Vector3.new(start)).Unit
However, I need to know what the origin is from this, is it pointing to the mouse from the character’s position? or the camera’s?
If it’s the character’s torso, for example, you would do this:
-- Assume every other variable is already set
local mouse = player:GetMouse()
local character = player.Character
local torso = character.Torso
local raycast = workspace:Raycast(torso.Position, (mouse.Hit.Position - torso.Position).Unit * 10)