x.CFrame = CFrame.new(char.UpperTorso.Position,Mouse.Hit.p) local bv = Instance.new("BodyVelocity", x) bv.maxForce = Vector3.new(math.huge,math.huge,math.huge) bv.velocity = x.CFrame.lookVector*20
^ This is the lines that involves CFrame and that stuff I know how to make the part go to the mouse's Position but not how to make it follow the mouse after executing it like pressing T and it gets created.
Make sure you use mouse.target, I would highly recommend only messing with X, and Z. When it comes to Y the part if you hold it still will move towards your camera. If you don't want it to clip then use MoveTo(); Make it run using UserInputService localScript
local Input = game:GetService("UserInputService") Input.InputBegan:connect(function(key) if key.KeyCode == Enum.KeyCode.T then repeat x.CFrame = CFrame.new(char.UpperTorso.Position,Mouse.Hit.p) local bv = Instance.new("BodyVelocity", x) bv.maxForce = Vector3.new(math.huge,math.huge,math.huge) bv.velocity = x.CFrame.lookVector*20 until game.Players.LocalPlayer:GetMouse().Button1Down end end)
Don't quote me from the code I gave you hopefully it works. Goodluck!