Hello. For my main menu I want the camera that we are using to tween to a certain position. Whenever I do this it ends up looking in a completely different way.
This is my script:
local Player = game.Players.LocalPlayer
local tweenService = game:GetService("TweenService")
local Camera = game.Workspace.CurrentCamera
local MenuCam = game.Workspace:WaitForChild("MenuCam")
local Process = false
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PlayPressed = ReplicatedStorage:WaitForChild("PlayPressed")
wait(game:IsLoaded())
MenuCam.Transparency = 1
Camera.CameraType = Enum.CameraType.Scriptable
Camera.FieldOfView = 50
local BlurEffect = Instance.new("BlurEffect")
BlurEffect.Size = 0
BlurEffect.Parent = game.Lighting
local Black = tweenService:Create(script.Parent:WaitForChild("Black"), TweenInfo.new(2,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out),
{Transparency = 0})
local UnBlack = tweenService:Create(script.Parent:WaitForChild("Black"), TweenInfo.new(2,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out),
{Transparency = 1})
local Blur = tweenService:Create(BlurEffect, TweenInfo.new(2,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out),
{Size = 20})
local UnBlur = tweenService:Create(BlurEffect, TweenInfo.new(1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.Out),
{Size = 0})
script.Parent:WaitForChild("GameMusic").Playing = true
script.Parent.PlayButton.MouseButton1Click:Connect(function()
if Process == true then return end
Process = true
Black:Play()
wait(3)
Camera.CameraType = Enum.CameraType.Custom
Camera.FieldOfView = 70
script.Parent.PlayButton:Destroy()
script.Parent.GameTitle:Destroy()
script.Parent.CuteBuddy:Destroy()
script.Parent.SpeechBubble:Destroy()
script.Parent.SpeechLabel:Destroy()
script.Parent:WaitForChild("GameMusic").Playing = false
Player.PlayerGui.RollGui.Enabled = true
print("RollUi enabled")
Player.PlayerGui.SideMenu.Enabled = true
print("SideUi enabled")
PlayPressed:FireServer() -- Notify the server
UnBlack:Play()
end)
If anyone would be so kind to tell me how to achieve this, it would be greatly appreciated.
Thank you so much,
Antlers