I have a vehicle and when the player gets in, I want the camera angle to pan over so that the player is facing the same direction that the vehicle is facing. Even better if you know how to make the camera turn with the vehicle when it is moving. Any tips would be great. So far I have looked at the players properties and tried to find something like a camera orientation so I can match that with the vehicle/block.
You’ll wanna use RenderStepped
to ensure the camera is constantly facing a certain direction via CFrame. Also make sure the CameraType is set to Scriptable
local RS = game:GetService("RunService")
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
RS.RenderStepped:Connect(function()
-- this will make the camera face the object's direction
-- while positioning it 10 studs above it
camera.CFrame = object.CFrame * CFrame.new(0, 10, 0)
end)
2 Likes