I have this movement script but I can’t figure out how to make the movement be dependant on the head’s orientation. I tried making it so the player moves in the direction they are facing but I’m not having any luck
UserInputService.InputChanged:Connect(function(input)
if input.UserInputType == Enum.UserInputType.Gamepad1 then
if input.KeyCode == Enum.KeyCode.Thumbstick1 then
thumbX = math.floor(input.Position.X * 10) / 20
thumbY = math.floor(input.Position.Y * 10) / 20
Camera.CFrame = Camera.CFrame * CFrame.new(thumbX,0,-thumbY)
elseif input.KeyCode == Enum.KeyCode.Thumbstick2 then
thumbY = math.floor(input.Position.Y * 10) / 20
Camera.CFrame = Camera.CFrame * CFrame.new(0,thumbY,0)
if math.abs(input.Position.Y) > math.abs(input.Position.X) then
thumbZ = math.floor(input.Position.Y * 10) / 20
elseif not rotated and math.abs(input.Position.X) > 0.9 then
rotated = true
Camera.CFrame = Camera.CFrame * CFrame.Angles(0,-input.Position.X/3,0)
end
end
end
end)
Any help is appreciated