Hello gamers, I’m trying to give a position and an orientation to the camera via CFrame, however I don’t know how to give orientation and surprisingly searching online yields results that are unrelated or straight up don’t work.
Here’s what I have right now.
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = CFrame.new(336.962, -40.25, 4.442)
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
-- Define position and orientation vectors
local position = Vector3.new(336.962, -40.25, 4.442)
local rightVector = Vector3.new(1, 0, 0) -- X-axis
local upVector = Vector3.new(0, 1, 0) -- Y-axis
local lookVector = Vector3.new(0, 0, 1) -- Z-axis
-- Set Camera CFrame
Camera.CFrame = CFrame.new(position, position + lookVector, upVector)
This is the entire script. Nothing else interacts with the camera at all.
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = workspace.CurrentCamera
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = CFrame.new(336.962, -40.25, 4.442) * CFrame.fromOrientation(-20, -60, 0)
i’m try to get a position of 336.962, -39.25, 4.442 and an orientation of -20, -60, 0. For some reason everything I try results in only one or neither.