I’m trying to make a top down game similar to the older MGS games, and i made this code after learning how to manipulate the camera.
My issue is that the rotation moves along with my character. How do i fix this?
Code:
local Plr = game.Players.LocalPlayer
local Char = Plr.Character or Plr.CharacterAdded:Wait()
local Primary = Char:WaitForChild("HumanoidRootPart")
local Cam = workspace.CurrentCamera
Cam.CameraType = Enum.CameraType.Scriptable
while true do
task.wait()
Cam.CFrame = Primary.CFrame * CFrame.new(0,25,0) * CFrame.fromEulerAnglesXYZ(math.rad(-90),0,0)
end
I need the rotation to stay looking down, and have it stay fixed like that.
Dont Use Primary.CFrame and actually make it use the Position of the player. The CFrame is the players position and players rotation if im correct. Im pretty sure all that needs to be done is
Cam.CFrame = Player.Position * CFrame.fromEulerAnglesXYZ(math.rad(-90),0,0)
I dont think that would work due to the fact that the player itself is an actual object with a position and thats why i used the position of the root part, since it has an actual position