script.Parent.Activated:Connect(function()
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local char = plr.Character
local waited = char:FindFirstChild("asdsd")
local x = Instance.new("BodyVelocity",waited)
waited.Anchored = false
x.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
x.Velocity = mouse.Hit.LookVector * 23
waited.Orientation = mouse.Hit.LookVector.Orientation
wait(2)
waited:Destroy()
end)
✓ ANSWER ACCEPTED
how do i make a part face towards the mouse?
1 answer
✓ Accepted answer
script.Parent.Activated:Connect(function()
local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()
local char = plr.Character
local waited = char:FindFirstChild("asdsd")
local x = Instance.new("BodyVelocity",waited)
waited.Anchored = false
x.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
x.Velocity = mouse.Hit.LookVector * 23
waited.CFrame = CFrame.new(waited.Position, mouse.Hit.Position) -- <<<<
wait(2)
waited:Destroy()
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
