I want to make a grapple gun system but I have a problem with MOBILE.
So mouse.Target on mobile is not good. On mobile you can click anywhere on the screen while on a computer (Your mouse is locked) you can only press the middle. I want it to work on my mobile by pressing a button on the screen to fire your grapple gun and retract it by pressing the button again. But I need an alternative to mouse.Target to still know what part the mobile player is clicking on with their fake mouse else I don’t know which part to grapple to. I have tried searching for systems but I don’t have a clue on how to actually make it work. It just keeps on failing. Or the ray doesn’t hit any parts. And I don’t want it to face with the head orientation, I want it to rotate the ray with the camera rotation of the player. It’s in first person by the way.
local camera = workspace.CurrentCamera
local cameraCF = camera.CFrame
local length = 1000
local params = RaycastParams.new()
local raycastResult = workspace:Raycast(cameraCF.Position, cameraCF.LookVector * length, params)
raycaseResult.Position is “The world space point at which the intersection occurred, usually a point directly on the surface of the instance.”, you can read more here: RaycastResult | Roblox Creator Documentation