How do I send a part located in my character's current position, towards the mouse's position?

I made a script where a part spawns on my character and I want it to go from my character and towards the place where I aim it towards but I don’t know how to. This is the script…


re.OnServerEvent:Connect(function(player, givenVector)
	local char = player.Character
	local part = Instance.new("Part", workspace)
	part.Position = char.HumanoidRootPart.Position
	game.Debris:AddItem(part, 2)
	
		
end)```

Well you already have the player’s position

And you can get the mouse’s position by doing this (since it only works on the client, use it as one of the parameters in your remote event)

local mouse = game:GetService("Players").LocalPlayer:GetMouse()
local mousePos = mouse.Hit.p

Hopefully this helps.

If you set the part’s network ownership to the player you can just move the part from the client with CFrames or a BodyPosition (note that means exploiters can move the part too, just like characters).

https://developer.roblox.com/en-us/api-reference/function/BasePart/SetNetworkOwner

Yeah, I didn’t show my local script but it has those arguments. But how do I send the part flying towards the mouse’s position?

But I want everyone to see the part moving. It’s only a simple test, but I plan on scripting magic abilities