I’m trying to make a game that is inspired by the Mario games, and I’m trying to figure ways I can do the level selection. One idea is how the selection is in Mario Brothers 2, where there’s a top down view and the player can walk along a path of levels and press a button to play the chosen level that is played from a side view.
The only problem is I don’t know if I could and how I can make the players viewpoint be changed from top down so side view. I already have a script for the side view, so would I just need to have it changed so that when the player enters the level select the view changes? If so how would I do that?
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
player.CharacterAdded:Wait()
player.Character:WaitForChild("HumanoidRootPart")
camera.CameraSubject = player.Character.HumanoidRootPart
camera.CameraType = Enum.CameraType.Attach
camera.FieldOfView = 40
local RunService = game:GetService("RunService")
local function onUpdate()
if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
camera.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position) * CFrame.new(0,0,30)
end
end
RunService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onUpdate)
Changing field of view is different than changing camera cframe. What I would do is have a remote event that fires to the player whenever they go into the level. Then on the client whenever the player gets that event, it will know to swap. I can’t write code rn because I’m on my phone but I’ll right some for you when I get back on my laptop.