local PUCKNAME = "Puck"
local TARGETNAME = "Sensor"
local ACTIVATORKEY = "Z"
local UIS = game:GetService("UserInputService")
UIS.InputBegan:Connect(function(key, isTyping)
if key.KeyCode == Enum.KeyCode[ACTIVATORKEY] and not isTyping then
test()
end
end)
function test()
local puck = workspace:FindFirstChild(PUCKNAME)
local sensor = workspace:FindFirstChild(TARGETNAME)
if puck and sensor then
puck.Velocity = CFrame.new(puck.Position, sensor.Position).lookVector * puck.Velocity.Magnitude
print("fired")
end
end
COMMUNITY QUESTION
Why this local script wont move a part to another part?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
have you tried using bodyposition or bodyvelocity instead
No
Simple question, but is the "Puck" anchored?
It is not