Issue with Mobile TouchTapInWorld Input in First-Person Mode: Inconsistent World Click Position

When I use TouchTapInWorld in first-person mode, the world click position is wonky, but it works perfectly in third-person. Do you have any ideas on why this is happening or how to fix it? It seems like the camera perspective might be affecting how the input is processed.

Third Person: https://gyazo.com/7dc7641d64e52ff441150eaa24168ce3
First Person: https://gyazo.com/b09c66183c3ded8bb61bc6c0a05fe692

Script:

		UserInputService.TouchTapInWorld:Connect(function(position: Vector2, gameProcessedEvent: boolean)
			if gameProcessedEvent then return end
			local unitRay = cam:ViewportPointToRay(position.X, position.Y)
			local ray = Ray.new(unitRay.Origin, unitRay.Direction * 300)
			local hitPart, worldPosition = Workspace:FindPartOnRay(ray)
			FreezeRay.Activate(worldPosition)
		end) 

That could be an issue with your raycast params not filtered correctly which makes the ray shoot at your character. Does aiming your cursor at your player while in third person also make the ray shoot at your character?

I’m ngl, I was just having one of those moments xD I felt dumb as soon as you said that LOOL, I changed my script, it doesnt use Ray.new anymore it is depricated, and it now excludes the players character thank you sir!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.