i have a problem on setting Camera’s CFrame.
i trying to make this camera work.
local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera
local function RearCamera()
Camera.CFrame = CFrame.lookAt(Camera.CFrame.Position+Vector3.new(3,0,0), Camera.Focus.Position+Vector3.new(3,0,0))
end
RunService:BindToRenderStep("RearCam", Enum.RenderPriority.Camera.Value + 1, RearCamera)
i think i try to use Camera.CFrame.LookVector
but i have no idea what should i do.
NVM i did it sorry
I thought about it for two days, but suddenly it was solved.
local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera
local Amount = 2
local function RearCamera()
Camera.CFrame = CFrame.lookAt(Camera.CFrame.Position, Camera.Focus.Position) * CFrame.new(Vector3.new((Camera.CFrame.LookVector.X*Amount)^2+(Camera.CFrame.LookVector.Z*Amount)^2,0,0))
print(Camera.CFrame.LookVector)
end
RunService:BindToRenderStep("RearCam", Enum.RenderPriority.Camera.Value + 1, RearCamera)
local RunService = game:GetService("RunService")
local Camera = workspace.CurrentCamera
local Amount = 2
local function SettingCamStart()
for A = 0,Amount do
Camera.CFrame = CFrame.lookAt(Camera.CFrame.Position, Camera.Focus.Position) * CFrame.new(Vector3.new((Camera.CFrame.LookVector.X*Amount)^2+(Camera.CFrame.LookVector.Z*Amount)^2,0,0))
wait(1)
end
end
local function SettingCamEnd()
Camera.CFrame = CFrame.lookAt(Camera.CFrame.Position, Camera.Focus.Position) * CFrame.new(Vector3.new((Camera.CFrame.LookVector.X*Amount)^2+(Camera.CFrame.LookVector.Z*Amount)^2,0,0))
RunService:UnbindFromRenderStep("SettingCamStart")
end
wait(3)
RunService:BindToRenderStep("SettingCamStart", Enum.RenderPriority.Camera.Value + 1, SettingCamStart)
wait(3)
RunService:BindToRenderStep("SettingCamEnd", Enum.RenderPriority.Camera.Value + 2, SettingCamEnd)
THIS MAKING ROLLING BUG
fixed myself again… lol Camera.CFrame = CFrame.lookAt(Root.Position-Camera.CFrame.LookVector*5, Root.Position) * CFrame.new(Vector3.new((Camera.CFrame.LookVector.X*Amount)^2+(Camera.CFrame.LookVector.Z*Amount)^2,0,0))