How Do I Remove The Default Console Reticle/Crosshair

Basically, I Have This 3rd Person Gun System That Uses A Custom Crosshair (Located in the tool). And When I Try To Aim In, Specifically Controller, The Crosshair DOES Work But It Goes in The Direction Of The Already Default Console Reticle (Top Middle Ish).



Here’s The Part of the script that i think is responsible for it:

			if UserInputService.TouchEnabled and Crosshair and Crosshair.MainFrame then
				local screenCenter = Crosshair.MainFrame.AbsolutePosition + Crosshair.MainFrame.AbsoluteSize / 2
				local ray = workspace.CurrentCamera:ScreenPointToRay(screenCenter.X, screenCenter.Y)
				local targetPosition = ray.Origin + ray.Direction * 1000
				MouseEvent:FireServer(targetPosition)
			else
1 Like

no thats for raycasting, press control F and search “icon”/ “mouseicon” (unless its an UI thing)

yea its a UI there’s no mouseicon in this script

local userInputService = game:GetService("UserInputService")
userInputService.GamepadConnected.MouseIconEnabled = false

Could you send the whole script then?

1 Like
-- Full script with mobile, controller, and PC compatibility fully integrated

local Tool = script.Parent
local Handle = Tool:WaitForChild("Handle")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local MouseEvent = Tool:WaitForChild("MouseEvent")

local Module = require(Tool.Server.GLOCK40)

local Mouse = Player:GetMouse()
local Camera = workspace.CurrentCamera
local FirePointObject = Handle:WaitForChild("GunFirePoint")

local Equipped = false
local CanFire = true
local CanAim = false
local Aimed = false
local Jammed = false

local Character = Player.Character or Player.Character:Wait()
local Humanoid = Character:WaitForChild("Humanoid")
local Idle = Humanoid:LoadAnimation(Tool.Animations.Hold)
local Down = Humanoid:LoadAnimation(Tool.Animations.Down)
local Fire = Humanoid:LoadAnimation(Tool.Animations.Fire)
local Reload = Humanoid:LoadAnimation(Tool.Animations.Reload)
local Equip = Humanoid:LoadAnimation(Tool.Animations.Equip)
local UnjamAnim = Humanoid:LoadAnimation(Tool.Animations.Unjam)
local Hold2 = Humanoid:LoadAnimation(Tool.Animations.Hold2)
local Fire2 = Humanoid:LoadAnimation(Tool.Animations.Fire2)

local CurrentIdle = Idle
local CurrentFire = Fire

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CrosshairService = require(ReplicatedStorage:WaitForChild("CrosshairService"))

local Crosshair
local GUI = Tool:WaitForChild("GunGUI")

local springmodule = require(Tool:WaitForChild("SpringModule"))
local recoilspring = springmodule.new()

-- Forward declarations to fix redlines
local ToggleAim
local TryReload
local TryUnjam
local TryShoot

local lastRecoil = Vector3.new()

RunService.RenderStepped:Connect(function(dt)
	local updated = recoilspring:update(dt)

	-- Subtract the last frame's rotation (undo it)
	Camera.CFrame *= CFrame.Angles(
		math.rad(-lastRecoil.x),
		math.rad(-lastRecoil.y),
		0
	)

	-- Apply this frame's rotation
	Camera.CFrame *= CFrame.Angles(
		math.rad(updated.x),
		math.rad(updated.y),
		0
	)

	-- Store this frame's rotation for the next one
	lastRecoil = updated
end)

-- EQUIP AND UNEQUIP
function OnEquipped()
	Equipped = true
	Equip:Play()
	Down:Play()
	local ClonedGUI = GUI:Clone()
	if not UserInputService.TouchEnabled and ClonedGUI:FindFirstChild("MobileButtons") then
		ClonedGUI.MobileButtons:Destroy()
	end
	ClonedGUI.Parent = Player.PlayerGui
	Crosshair = CrosshairService.new(ClonedGUI.Crosshair, 10)
	ClonedGUI.Crosshair.Visible = false
	if ClonedGUI.Crosshair:FindFirstChild("Center") then
		ClonedGUI.Crosshair.Center.Visible = false
		ClonedGUI.Crosshair.Center.BackgroundTransparency = 1
	end
	if UserInputService.TouchEnabled then
		local buttons = ClonedGUI:FindFirstChild("MobileButtons")
		if buttons then
			buttons.FireButton.MouseButton1Down:Connect(TryShoot)
			buttons.AimButton.MouseButton1Click:Connect(function()
				ToggleAim(not Aimed)
			end)
			buttons.ReloadButton.MouseButton1Click:Connect(TryReload)
			buttons.Unjam.MouseButton1Click:Connect(TryUnjam)
		end
	end
	UserInputService.InputBegan:Connect(function(input, processed)
		if processed then return end
		if input.UserInputType == Enum.UserInputType.Gamepad1 then
			if input.KeyCode == Enum.KeyCode.ButtonR2 then
				TryShoot()
			elseif input.KeyCode == Enum.KeyCode.ButtonL2 then
				ToggleAim(true)
			elseif input.KeyCode == Enum.KeyCode.ButtonX then
				TryReload()
			elseif input.KeyCode == Enum.KeyCode.ButtonB then
				TryUnjam()
			end
		end
	end)
	UserInputService.InputEnded:Connect(function(input, processed)
		if processed then return end
		if input.UserInputType == Enum.UserInputType.Gamepad1 and input.KeyCode == Enum.KeyCode.ButtonL2 then
			ToggleAim(false)
		end
	end)
	Player.Character.CanRun.Value = false
	task.wait(0.339)
	Player.Character.CanRun.Value = true
	CanAim = true
end

function OnUnequipped()
	Equipped = false
	TweenService:Create(Humanoid, TweenInfo.new(0.4), {CameraOffset = Vector3.new()}):Play()
	Player.CameraMinZoomDistance = 3
	Player.CameraMaxZoomDistance = 20
	_G.ForceShiftLock = false
	Idle:Stop()
	Down:Stop()
	Fire:Stop()
	Hold2:Stop()
	Fire2:Stop()
	Reload:Stop()
	Equip:Stop()
	UnjamAnim:Stop()
	if Player.PlayerGui:FindFirstChild("GunGUI") then Player.PlayerGui.GunGUI:Destroy() end
	if Crosshair then Crosshair:Disable() end
	Player.Character.CanRun.Value = true
	if Player.Character:FindFirstChild("Running") and not Player.Character.Running.Value then
		Humanoid.WalkSpeed = 10
	end
end

Tool.Equipped:Connect(OnEquipped)
Tool.Unequipped:Connect(OnUnequipped)

-- SHOOT FUNCTION
TryShoot = function()
	if not Equipped or not Aimed or not CanFire or Jammed then return end
	if Tool.Clip.Value > 0 then
		if math.random(Module.JAMNUMBER, Module.JAMCHANCE) == Module.JAMNUMBER then
			Jammed = true
			Tool.GunJammed:FireServer()
		else
			CanFire = false
			if CurrentIdle.IsPlaying then
				CurrentIdle:Stop()
			end
			if UserInputService.TouchEnabled and Crosshair and Crosshair.MainFrame then
				local screenCenter = Crosshair.MainFrame.AbsolutePosition + Crosshair.MainFrame.AbsoluteSize / 2
				local ray = workspace.CurrentCamera:ScreenPointToRay(screenCenter.X, screenCenter.Y)
				local targetPosition = ray.Origin + ray.Direction * 1000
				MouseEvent:FireServer(targetPosition)
			else
				MouseEvent:FireServer(Mouse.Hit.Position)
			end
			if Module.SHAKEENABLED then
				recoilspring.Speed = Module.RECOILSPEED
				recoilspring:shove(Vector3.new(Module.Y_RECOIL, Module.X_RECOIL, Module.Z_RECOIL))
			end
			CurrentFire:Stop()
			CurrentFire = Player.Character.Running.Value and Fire2 or Fire
			CurrentFire:Play()
			task.wait(Module.COOLDOWN)
			if Aimed then
				CurrentIdle = Player.Character.Running.Value and Hold2 or Idle
				CurrentIdle:Play(0.2)
			end
			CanFire = true
		end
	else
		Tool.PlayAudio:FireServer("Empty")
		CurrentFire:Stop()
		CurrentFire = Player.Character.Running.Value and Fire2 or Fire
		CurrentFire:Play()
	end
end

-- AIM TOGGLE
local runningConn
ToggleAim = function(on)
	if not Equipped then return end
	if on and not Aimed and CanAim then
		if runningConn then runningConn:Disconnect() end
		runningConn = Player.Character:WaitForChild("Running").Changed:Connect(function()
			if not Equipped or not Aimed then return end
			if Player.Character.Running.Value then
				CurrentIdle:Stop()
				CurrentIdle = Hold2
				CurrentFire = Fire2
				CurrentIdle:Play(0.2)
			else
				CurrentIdle:Stop()
				CurrentIdle = Idle
				CurrentFire = Fire
				CurrentIdle:Play(0.2)
			end
		end)
		if Player.Character.Running.Value then
			CurrentIdle = Hold2
			CurrentFire = Fire2
		else
			CurrentIdle = Idle
			CurrentFire = Fire
		end
		CurrentIdle:Play(0.2)
		Down:Stop()
		Aimed = true
		TweenService:Create(Humanoid, TweenInfo.new(0.2), {CameraOffset = Vector3.new(1.75, 0.2, 0.2)}):Play()
		Player.CameraMinZoomDistance = 2
		Player.CameraMaxZoomDistance = 2
		_G.ForceShiftLock = true
		Tool.PlayAudio:FireServer("Raise")
		if Crosshair then Crosshair:Enable() end
		if Crosshair and Crosshair.MainFrame then
			Crosshair.MainFrame.Visible = true
		end
		if Crosshair and Crosshair.MainFrame:FindFirstChild("Center") then
			local center = Crosshair.MainFrame.Center
			center.Visible = true
			center.ImageTransparency = 1
			TweenService:Create(center, TweenInfo.new(0.25), {ImageTransparency = 0}):Play()
		end
		Humanoid.WalkSpeed = Player.Character.Running.Value and 16 or 10
		Player.Character.CanRun.Value = true
	elseif not on and Aimed then
		if runningConn then runningConn:Disconnect() runningConn = nil end
		CurrentIdle:Stop()
		if Player.Character.Running.Value then
			CurrentIdle = Hold2
			CurrentFire = Fire2
		else
			CurrentIdle = Idle
			CurrentFire = Fire
		end
		Down:Play()
		Aimed = false
		TweenService:Create(Humanoid, TweenInfo.new(0.2), {CameraOffset = Vector3.new()}):Play()
		Player.CameraMinZoomDistance = 3
		Player.CameraMaxZoomDistance = 20
		_G.ForceShiftLock = false
		Tool.PlayAudio:FireServer("Lower")
		if Crosshair then Crosshair:Disable() end
		if Crosshair and Crosshair.MainFrame then
			task.delay(0.25, function() Crosshair.MainFrame.Visible = false end)
		end
		if Crosshair and Crosshair.MainFrame:FindFirstChild("Center") then
			local center = Crosshair.MainFrame.Center
			TweenService:Create(center, TweenInfo.new(0.25), {ImageTransparency = 1}):Play()
			task.delay(0.25, function() center.Visible = false end)
		end
		Humanoid.WalkSpeed = 10
		Player.Character.CanRun.Value = true
	end
end

-- RELOAD
TryReload = function()
	if Equipped and Tool.Clip.Value < Module.MAXCLIP and Player.Backpack:FindFirstChild(Module.MAG) then
		CanFire = false
		CanAim = false
		Reload:Play()
		Tool.ReloadEvent:FireServer()
		Player.Character.CanRun.Value = false
		task.wait(2.773)
		Player.Character.CanRun.Value = true
		CanAim = true
		CanFire = true
	end
end

-- UNJAM
TryUnjam = function()
	if Equipped and Tool.Clip.Value > 0 then
		CanFire = false
		Tool.UnjamEvent:FireServer()
		UnjamAnim:Play()
		game.ReplicatedStorage.Remotes.BlikBack:FireServer("BlikBack")
		Jammed = false
		task.wait(0.84)
		CanFire = true
	end
end

-- INPUT HOOKS
Mouse.Button1Down:Connect(TryShoot)
Mouse.Button2Down:Connect(function() ToggleAim(true) end)
Mouse.Button2Up:Connect(function() ToggleAim(false) end)

UserInputService.InputBegan:Connect(function(input, processed)
	if processed then return end
	if input.KeyCode == Enum.KeyCode.R or input.KeyCode == Enum.KeyCode.ButtonX then
		TryReload()
	elseif input.KeyCode == Enum.KeyCode.F or input.KeyCode == Enum.KeyCode.ButtonB then
		TryUnjam()
	end
end)

UserInputService.InputEnded:Connect(function(input, processed)
	if processed then return end
	if input.KeyCode == Enum.KeyCode.ButtonL2 then
		ToggleAim(false)
	end
end)

-- MOBILE BUTTONS
-- Removed task.defer version to ensure fresh setup on every equip
local CrosshairService = {}
CrosshairService.__index = CrosshairService

local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")

---------- Local Functions ----------
local function Update(Crosshair, DeltaTime : number)
	if Crosshair.Frozen then return end
	local Mouse_Location = UserInputService:GetMouseLocation()
	Crosshair.MainFrame.Position = UDim2.new(0,Mouse_Location.X,0,Mouse_Location.Y)
end

local function PosTable_Func(Radius : number)
	return {
		Top = UDim2.new(0, 0, 0, -Radius - 7),
		Left = UDim2.new(0, -Radius - 7, 0, 0),
		Right = UDim2.new(0, Radius, 0, 0),
		Bottom = UDim2.new(0, 0, 0, Radius)
	}
end

---------- Objected Oriented Functions ----------
function CrosshairService.new(MainFrame : Frame, Radius : number, EasingStyle : Enum.EasingStyle, EasingDirection : Enum.EasingDirection, Lerp : number)
	local NewCrosshair = {}
	setmetatable(NewCrosshair, CrosshairService)
	
	NewCrosshair.MainFrame = MainFrame
	NewCrosshair.Enabled = nil
	NewCrosshair.EasingStyle = EasingStyle or Enum.EasingStyle.Quint
	NewCrosshair.EasingDirection = EasingDirection or Enum.EasingDirection.Out
	NewCrosshair.Lerp = Lerp or 1
	NewCrosshair.Radius = Radius or 50
	NewCrosshair.Frozen = false
	
	NewCrosshair:Disable()
	NewCrosshair:Set(NewCrosshair.Radius)
	
	return NewCrosshair
end

function CrosshairService:Set(Radius : number, Can_Animate : boolean, EasingStyle : Enum.EasingStyle, EasingDirection : Enum.EasingDirection, Lerp : number)
	if typeof(Radius) ~= "number" then warn("Argument #1 is not a valid radius") return end
	if typeof(Can_Animate) ~= "boolean" then Can_Animate = false end
	self.Radius = Radius
	
	local PosTable = PosTable_Func(self.Radius)
	for i,Position in pairs(PosTable) do
		if Can_Animate then
			local Tween = TweenService:Create(self.MainFrame[i], TweenInfo.new(Lerp or self.Lerp, EasingStyle or self.EasingStyle, EasingDirection or self.EasingDirection), {Position = Position})
			Tween:Play()
		else
			self.MainFrame[i].Position = Position
		end
	end
end

function CrosshairService:Shove(Radius : number, EasingStyle : Enum.EasingStyle, EasingDirection : Enum.EasingDirection, Lerp : number)
	if typeof(Radius) ~= "number" then warn("Argument #1 is not a valid radius") return end
	self.MainFrame.Top.Position = UDim2.new(0, 0, 0, -self.Radius - 7 - Radius)
	self.MainFrame.Left.Position = UDim2.new(0, -self.Radius - 7 - Radius, 0, 0)
	self.MainFrame.Right.Position = UDim2.new(0, self.Radius + Radius, 0, 0)
	self.MainFrame.Bottom.Position = UDim2.new(0, 0, 0, self.Radius + Radius)
	
	local PosTable = PosTable_Func(self.Radius)
	for i,Position in pairs(PosTable) do
		local Tween = TweenService:Create(self.MainFrame[i], TweenInfo.new(Lerp or self.Lerp, EasingStyle or self.EasingStyle, EasingDirection or self.EasingDirection), {Position = Position})
		Tween:Play()
	end
end

function CrosshairService:Freeze()
	if self.Frozen == true then warn("Attempt to freeze already frozen crosshair") return end
	self.Frozen = true
end

function CrosshairService:UnFreeze()
	if self.Frozen == false then warn("Attempt to unfreeze already unfrozen crosshair") return end
	self.Frozen = false
end

function CrosshairService:Enable()	
	if self.Enabled == true then warn("Attempt to enable already enabled crosshair") return end
	self.Enabled = true
	self.MainFrame.Visible = true
	UserInputService.MouseIconEnabled = false
	
	RunService:BindToRenderStep("CrosshairService_Update", Enum.RenderPriority.Camera.Value, function(DeltaTime : number)
		Update(self, DeltaTime)
	end)
end

function CrosshairService:Disable()
	if self.Enabled == false then warn("Attempt to disable already disabled crosshair") return end
	self.Enabled = false
	self.MainFrame.Visible = false
	UserInputService.MouseIconEnabled = true
	
	RunService:UnbindFromRenderStep("CrosshairService_Update")
end

function CrosshairService:Destroy()
	RunService:UnbindFromRenderStep("CrosshairService_Update")
	self.MainFrame:Destroy()
	table.clear(self)
	UserInputService.MouseIconEnabled = true
end

return CrosshairService

and the problem was that your custom crosshair is offset to the top right?

right, like top middle ish kinda

The PosTable_Func function just calculates and returns the positions of each crosshair segment based on a given radius, positioning them evenly around the screen center. so it dosent rlly move the console reticle

man this is so complex for me I can’t even find the aim part :sob:

“GamepadConnected” is a RBXScriptSignal.

2 Likes

Dang, you right.

I just assumed that’s what I did in my game, as I couldn’t find it before. I did some digging, and my input system gets rid of the dot/reticle by disabling the mouse icon when gamepad input is known:

The relevent thing:

UserInputService.MouseIconEnabled = true

Here’s my input system code:

local userInputService = game:GetService("UserInputService")
local GamepadService = game:GetService("GamepadService")

----
local UserInputTypeSystemModule = { 

	gamepadTypeFromNewestInput = "none",
	inputTypeThePlayerIsUsing = "KeyboardAndMouse", --keyboard mouse is default
	gamepadType = "none", -- "none" by default. Can be "Xbox" or "PlayStation"
	
}

----
local mouseInputType = {
		Enum.UserInputType.MouseButton1,
		Enum.UserInputType.MouseButton2,
		Enum.UserInputType.MouseButton3,
		Enum.UserInputType.MouseMovement, 
		Enum.UserInputType.MouseWheel	
}

local GamepadInputsList = {
	Enum.KeyCode.ButtonA,
	Enum.KeyCode.ButtonB,
	Enum.KeyCode.ButtonX,
	Enum.KeyCode.ButtonY,

	Enum.KeyCode.ButtonL1,
	Enum.KeyCode.ButtonL2,
	Enum.KeyCode.ButtonL3,

	Enum.KeyCode.ButtonR1,
	Enum.KeyCode.ButtonR2,
	Enum.KeyCode.ButtonR3,

	Enum.KeyCode.ButtonStart,
	Enum.KeyCode.ButtonSelect,
	
	--

	Enum.KeyCode.DPadUp,
	Enum.KeyCode.DPadDown,
	Enum.KeyCode.DPadLeft,
	Enum.KeyCode.DPadRight,
	
	Enum.KeyCode.Thumbstick1,
	Enum.KeyCode.Thumbstick2,


}

local mobileInputType = Enum.UserInputType.Touch

---
local Xbox_ReturnValues_List = {
	
	"ButtonA", -- KeyCode.ButtonA
	"ButtonB", -- KeyCode.ButtonB
	"ButtonX", -- KeyCode.ButtonX
	"ButtonY", -- KeyCode.ButtonY
	"ButtonLB", -- KeyCode.ButtonL1
	"ButtonLT", -- KeyCode.ButtonL2
	"ButtonLS", -- KeyCode.ButtonL3
	"ButtonRB", -- KeyCode.ButtonR1
	"ButtonRT", -- KeyCode.ButtonR2
	"ButtonRS", -- KeyCode.ButtonR3
	"ButtonStart", -- KeyCode.ButtonStart
	"ButtonSelect", -- KeyCode.ButtonSelect 
	
}

local PlayStation_ReturnValues_List = {
	
	"ButtonCross", -- KeyCode.ButtonA
	"ButtonCircle", -- KeyCode.ButtonB
	"ButtonSquare", -- KeyCode.ButtonX
	"ButtonTriangle", -- KeyCode.ButtonY
	"ButtonL1", -- KeyCode.ButtonL1
	"ButtonL2", -- KeyCode.ButtonL2
	"ButtonL3", -- KeyCode.ButtonL3
	"ButtonR1", -- KeyCode.ButtonR1
	"ButtonR2", -- KeyCode.ButtonR2
	"ButtonR3", -- KeyCode.ButtonR3
	"ButtonOptions", -- KeyCode.ButtonStart
	
	"ButtonTouchpad", -- KeyCode.ButtonSelect 
	"ButtonShare", -- KeyCode.ButtonSelect 

}
-- Note: Directional inputs have the same return value. This means, if a player presses a d-pad input, then the code knows it's a gamepad, but it doesn't know what type of gamepad. (PlayStation or Xbox, not sure.) 
---


function UserInputTypeSystemModule.GetInputStringToActuallyDisplayToUser(inputKeyCode)	
	local stringToShowAsText = false
	
	--print("-------")
	local stringOfKeycode = tostring(inputKeyCode)
	local cutString = string.sub(stringOfKeycode,14)
	local enumThing = Enum.KeyCode[cutString]
	--print(stringOfKeycode)
	--print(cutString)
	--print(enumThing)

	-- Below accounts for other keyboards: 
	-- https://create.roblox.com/docs/reference/engine/classes/UserInputService#GetStringForKeyCode

	local success, errorMessage = pcall(function()
		stringToShowAsText = userInputService:GetStringForKeyCode(inputKeyCode)
	end)

	if success then
		if stringToShowAsText == nil or stringToShowAsText == "" or stringToShowAsText == " " or stringToShowAsText == "  " then
			stringToShowAsText = enumThing.Name
			--print(stringToShowAsText)
		end
	else 
		--warn(errorMessage)
		stringToShowAsText = enumThing.Name
		--print(stringToShowAsText)
	end
	
	return stringToShowAsText
end

userInputService.InputBegan:Connect(function(input)
	-- Keyboard & Mouse Input: --
	if input.UserInputType == Enum.UserInputType.Keyboard then -- Keyboard inputs --
		if UserInputTypeSystemModule.inputTypeThePlayerIsUsing == "Gamepad" or UserInputTypeSystemModule.inputTypeThePlayerIsUsing == "Touch" then
			print("New InputType detected: Keyboard and Mouse")
			UserInputTypeSystemModule.inputTypeThePlayerIsUsing = "KeyboardAndMouse"
			userInputService.MouseIconEnabled = true
			return
		end
	end
	for i, mouseInputs in pairs (mouseInputType) do -- Mouse inputs --
		if input.UserInputType == mouseInputs  then
			if UserInputTypeSystemModule.inputTypeThePlayerIsUsing ~= "KeyboardAndMouse" then
				print("New InputType detected: Keyboard and Mouse")
				UserInputTypeSystemModule.inputTypeThePlayerIsUsing = "KeyboardAndMouse"
				userInputService.MouseIconEnabled = true
				return
			end
		end
	end
	----
	
		
	-- Gamepad Input: --

	for i, gamepadInput in pairs (GamepadInputsList) do -- Controller button inputs --
		if input.KeyCode == gamepadInput  then 
									
			if UserInputTypeSystemModule.inputTypeThePlayerIsUsing ~= "Gamepad" then
				print("New InputType detected: Gamepad")
				UserInputTypeSystemModule.inputTypeThePlayerIsUsing = "Gamepad"
				userInputService.MouseIconEnabled = false
			end
			
			local stringForKeyCodePressed = userInputService:GetStringForKeyCode(gamepadInput)
			if stringForKeyCodePressed == nil or stringForKeyCodePressed == "" or stringForKeyCodePressed == " " or stringForKeyCodePressed == "  " then
				stringForKeyCodePressed = gamepadInput.Name
			end
			
			for i, returnValue_Xbox in pairs(Xbox_ReturnValues_List) do
				if returnValue_Xbox == stringForKeyCodePressed then
					--print(retunValue_Xbox,stringForKeyCodePressed)
					UserInputTypeSystemModule.gamepadTypeFromNewestInput = "Xbox"
				end
			end
			
			for i, returnValue_PlayStation in pairs(PlayStation_ReturnValues_List) do
				if returnValue_PlayStation == stringForKeyCodePressed then
					--print(returnValue_PlayStation,stringForKeyCodePressed)
					UserInputTypeSystemModule.gamepadTypeFromNewestInput = "PlayStation"
				end
			end			
			
			if UserInputTypeSystemModule.gamepadTypeFromNewestInput ~= UserInputTypeSystemModule.gamepadType then
				-- player is now using a different type of gamepad than before
				
				UserInputTypeSystemModule.gamepadType = UserInputTypeSystemModule.gamepadTypeFromNewestInput
				print(UserInputTypeSystemModule.gamepadType)
			end
		end
	end
	----
	
	
	-- Touchscreen input: --
	if input.UserInputType == Enum.UserInputType.Touch then
		if UserInputTypeSystemModule.inputTypeThePlayerIsUsing ~= "Touch" then -- if not mobile/touch input already, make it.
			UserInputTypeSystemModule.gamepadTypeFromNewestInput = "none"
			print("New InputType detected: Touch")
			UserInputTypeSystemModule.inputTypeThePlayerIsUsing = "Touch"
		end
	end
end)

return UserInputTypeSystemModule