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.
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!