Now before I start, I just want to let you know that there is a solution for this by madattak. I just want to see if there is a better way.
I am currently modifying AxisAngle’s skydiving script and trying to make it mobile compatible. Here is the piece of the code that requires the key codes:
function KeyPressed(input)
if input.UserInputType == Enum.UserInputType.Keyboard then
Key = input.KeyCode
if Key == Enum.KeyCode.D or Key == Enum.KeyCode.DPadRight then
TwistConvergence = 1.2
end
if Key == Enum.KeyCode.A or Key == Enum.KeyCode.DPadLeft then
TwistConvergence = -1.2
end
if Key == Enum.KeyCode.W or Key == Enum.KeyCode.DPadUp then
TiltConvergence = 1
end
if Key == Enum.KeyCode.S or Key == Enum.KeyCode.Down then
TiltConvergence = -1
end
end
end
function KeyUnpressed(input)
if input.UserInputType == Enum.UserInputType.Keyboard or input.UserInputType == Enum.UserInputType.Touch then
Key = input.KeyCode
if Key == Enum.KeyCode.D or Key == Enum.KeyCode.A or Key == Enum.KeyCode.DPadLeft or Enum.KeyCode.DPadRight then
TwistConvergence = 0
end
if Key == Enum.KeyCode.W or Key == Enum.KeyCode.S or Key == Enum.KeyCode.DPadUp or Enum.KeyCode.DPadDown then
TiltConvergence = 0
end
end
end
What I want to do is to replace those “DPad” things with Thumbstick ones. By the way, the DPad does not work either, for some reason.
Is there a better way than madattak’s? All help is appreciated!