how do you implement camera's lookvector looking down or up to the part
Right now achieved getting the Left and Right camera's axis here's my script:
local cam = Camera.CFrame.LookVector local Rot1 = math.atan2(-cam.X, -cam.Z) local CamLookAt = CFrame.new(Torso.Position) * CFrame.Angles(0, Rot1, 0) Seat.CFrame = CamLookAt --// the seat copy's my camera's lookvector but only left and right.
But now i want to implement up and down lookvector of the camera to the part.
which is the X axis and i tried doing this i have no idea.
Rot2 = math.rad(cam.X) local CamLookAt = CFrame.new(Torso.Position) * CFrame.Angles(Rot2, Rot1, 0)
Keep the X and Z axis of the LookVector and set the Y to the Y (height) of the object you want to look up/down at.
Example:
local oldLook = Camera.CFrame.LookVector Camera.CFrame = CFrame.new(Camera.CFrame.Position, Vector3.new(oldLook.X, NEW HEIGHT (Y), oldLook.Z)