How to make console players move there cursor freely?

Hello developers I’m making a game like Medal of honor from 1999 and I have a issue I’m trying to figure out how to make when a player Hold LT/L2 And when they move the right joystick a fake cursor comes and when you shoot at the position the fake cursor at it actually shoot there for first person btw

2 Likes

Well, you’ll have to make a fake cursor, like you said. You’ll use the gamepad parts of UserInputService to handle the gamepad inputs, which will control the fake cursor. Then you’ll make a Raycast from that point of the screen, which might look something like this:

local function RaycastFromScreen(xPos:number,yPos:number,distance:number?,params:RaycastParams?)
	distance = distance or 2048
	params = params or RaycastParams.new()
	local camera = workspace.CurrentCamera
	local unitRay = camera:ScreenPointToRay(xPos,yPos)
	local origin = unitRay.Origin
	local direction = unitRay.Direction*distance
	return workspace:Raycast(origin,direction,params)
end

But you’ll likely want to add your own RaycastParams, that way you can exclude things like the player’s character.

(Also, this post may be better placed in Help and Feedback > Scripting Support.)

where i put the script by the way i kinda dont know how to like do these confusing ones or you know