local camera = game.Workspace.CurrentCamera
-- Function to get and print the look direction
local function printLookDirection()
local lookVector = camera.CFrame.LookVector
print("Look Direction: ", lookVector)
end
-- Example of calling the function in a loop, e.g., once per second
while true do
printLookDirection()
wait(1)
end
You can also use heartbeat or run service to continually get position
local function UpdatePartsDirection()
local player = game.Players.LocalPlayer
local camera = game.Workspace.CurrentCamera
local lookVector = camera.CFrame.LookVector
part1.CFrame = CFrame.new(part1.Position, part1.Position + lookVector)
part2.CFrame = CFrame.new(part2.Position, part2.Position + lookVector)
end
game:GetService("RunService").RenderStepped:Connect(UpdatePartsDirection)