Camera not rotate fully

*English not so good

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

Camera orientation set to -20, 90, 0

  1. What is the issue? Include screenshots / videos if possible!

So the script did changed the 90 Degrees but not the -20 Degrees


  1. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Can’t find somthing similar

  1. Explaination

The code is in Local Script and i placed the local script in StarterGUI,
i try using fromEulerAngles, Angles, fromEulerAnglesXYZ nothing changed

Entire Code:

local Camera = workspace.CurrentCamera

local ScreenGUI = script.Parent
local Character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()

local TeamBlue = script.Parent.Blue
local TeamRed = script.Parent.Red

TeamRed.MouseButton1Click:Connect(function()
	
	local Red = Color3.fromRGB(255,0,0)
	
	RemoteEvent:FireServer(Red, Character)
	Camera.CFrame = Camera.CFrame * CFrame.fromEulerAngles(math.rad(-20), math.rad(90), 0)
	
	ScreenGUI:Destroy()
	
end)

TeamBlue.MouseButton1Click:Connect(function()
	
	local Blue = Color3.fromRGB(0,0,255)
	
	RemoteEvent:FireServer(Blue, Character)
	ScreenGUI:Destroy()
	
end)
1 Like

Try CFrame.fromOrientation instead.

2 Likes

It kinda work but it kinda little bit off

Do i still need to use math.rad or something cause it slightly off

2 Likes

The default camera script is likely causing the angles to be slightly off, you could try using different math.rad values in order to get closer to the desired angles.

1 Like

is there a way to round up the number to remove the .093 and everything behind it?

Nevermind i already fixed it!

I just changed this :

Camera.CFrame = Camera.CFrame * CFrame.fromOrientation(math.rad(-20),math.rad(90), 0)

Into This :

Camera.CFrame = CFrame.fromOrientation(math.rad(-20),math.rad(90), 0)

so the number never misallign

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.