I am working on a paltformer game, and i have it done for PC so far, but i am troubled on the Xbox part.
I am very new to scripting with XBOX compatible controls, and i only know how to keybind with the controller so far.
I am trying to find out how to detect when the player moves the Thumbstick1 to the left/right, like how you can detect if someone presses A/D to move left/right.
I need it because on my came when they press A, they face left and when they press D they face right. I cant figure out how to do it for controllers.
If you can help please do. Thanks!
Keybind version:
local Player = game.Players.LocalPlayer
repeat wait() until Player.Character
local Character = Player.Character
local Torso = Character.UpperTorso
local Mouse = Player:GetMouse()
Character.Humanoid.AutoRotate = false
local bp = Instance.new("BodyPosition", Torso)
bp.MaxForce = Vector3.new(0, 0, math.huge)
bp.Position = Vector3.new(0, 0,Torso.Position.Z)
Mouse.KeyDown:connect(function(key)
if key == "a" then
Character.UpperTorso.CFrame = CFrame.new(Character.UpperTorso.Position, workspace.Left.Position)
elseif key == "d" then
Character.UpperTorso.CFrame = CFrame.new(Character.UpperTorso.Position, workspace.Right.Position)
end
end)

1 comment
Oh Ok. Thanks for that Lol.