The question in the title,
I try to make a script where I can fly with a jetpack. Now the keyboard controls work. But the controller controls aren’t working.
UIS.InputBegan:Connect(function(input,ignore)
if ignore then return end
if input.KeyCode == keybind or input.KeyCode == xbox_keybind then
Enable(Enum.UserInputState.Begin)
end
if enabled then
if input.KeyCode == Enum.KeyCode.W then
forward = 1
end
if input.KeyCode == Enum.KeyCode.S then
backward = -1
end
if input.KeyCode == Enum.KeyCode.D then
right = 1
end
if input.KeyCode == Enum.KeyCode.A then
left = -1
end
if input.KeyCode == Enum.KeyCode.Thumbstick1 then
local x,y = input.Keycode.Position.X,input.Keycode.Position.Y
print(y,x)
if y >= 0.1 then
forward = 1
end
if y <= -0.1 then
backward = -1
end
if x >= 0.1 then
right = 1
end
if x <= -0.1 then
left = -1
end
end
end
end)