I’m making a sandbox where you are a giant and there are little people that are as big as your feet. I want it so I can move the NPC’s character by holding it down with mouse. How would I do this? (BTW I already did Button1Down and Button1Up)
Have you tried using UserInputService as an alternative? I’m not sure if Button1Down / up are deprecated but using UIS just seems more efficient.
I haven’t tried that yet. Do you possibly have an example or such? (As in the “move object” part)
Yes, here is a quick example
local UIS = game:GetService("UserInputService")
local player = game:GetService("Players").LocalPlayer
UIS.InputBegan:Connect(function(InputKey, GPE)
if GPE then return end
if InputKey.UserInputType == Enum.UserInputType.MouseButton1 then
print("Mouse button 1 is held down")
end
end)
UIS.InputEnded:Connect(function(InputKey, GPE)
if GPE then return end
if InputKey.UserInputType == Enum.UserInputType.MouseButton1 then
print("Let go of mouse button 1")
end
end)
1 Like