Hello people,
I have some troubles with a 2D Camera that changes its its Orientation when the player touches the button.
Currently, the view for the character is in the Front View for the Z-axis before touching the button.
What I want is to have the view on the Right Side of the Z-axis after touching the button
I have tried using CFrame.fromOrientation() and CFrame.Angles() both having 90 degrees on the Y-axis.
This is the View without tampering with the CFrame’s Angles
This is the view of the Angles at (0,90,0)
It shows the left side of the Baseplate.
This is the Camera Script
local plr = game.Players.LocalPlayer
local cam = workspace.CurrentCamera
plr.CharacterAdded:Wait()
plr.Character:WaitForChild("HumanoidRootPart")
cam.CameraSubject = plr.Character.HumanoidRootPart
cam.CameraType = Enum.CameraType.Attach
cam.FieldOfView = 40
local RunService = game:GetService("RunService")
local function onUpdate()
if plr.Character and plr.Character:FindFirstChild("HumanoidRootPart") then
cam.CFrame = CFrame.new(plr.Character.HumanoidRootPart.Position) * CFrame.new(0,3,50) * CFrame.fromOrientation(0,90,0)
end
end
RunService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onUpdate)
I suppose that the Position of the Camera affects the View Angle of the Camera.
Thanks for helping! (In advance)