The position of camera direction

How i can get the position (vector3) of the side the camera is facing

I wanna get position (vector3) of camera direction like mouse.hit but with camera

I’m used this script but it’s dont working perfect

local origin = game.Workspace.Camera
local direction = origin + (math.huge,0,0)
local raycastresult = workspace:Raycast(origin,direction)

sorry for my bad English.

1 Like

I believe what you’re looking for is a LookVector which is a property of CFrame.

It describes a unit vector in the direction the CFrame is facing.

local distance = 1000
local origin = game.Workspace.Camera
local direction = origin.LookVector * distance
local raycastresult = workspace:Raycast(origin,direction)
2 Likes

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