After my script completes a tween to the camera it just teleports and i have no idea why.
-
What do you want to achieve? I wan’t to fix that, but i have no idea how.
-
What is the issue? The camera teleports after completing a tween.
-
What solutions have you tried so far? I tried to search in YT, Devforum, but i found nothing to help and that’s why im creating this topic.
Im makin a hiding system for my horror game and i want it to be smooth. So i really wan’t to fix this.
movecamEvent.OnClientEvent:Connect(function(cframe, argument, cameraPlace)
humanoid.CameraOffset = Vector3.new(0,0,0)
if argument == "closet" then
local currentCamera = workspace.CurrentCamera
currentCamera.CameraType = Enum.CameraType.Scriptable
local tween = tweenService:Create(currentCamera, TweenInfo.new(0.5), {CFrame = cframe})
tween:Play()
task.wait(0.5)
currentCamera.CameraType = Enum.CameraType.Custom
--
elseif argument == "bed" then
if cameraPlace == "inside" then
animate:Fire(argument, "inside")
local currentCamera = workspace.CurrentCamera
currentCamera.CameraType = Enum.CameraType.Scriptable
local tween = tweenService:Create(currentCamera, TweenInfo.new(0.5), {CFrame = cframe})
tween:Play()
task.wait(0.5)
humanoid.CameraOffset = Vector3.new(0, -3.35, 0)
currentCamera.CameraType = Enum.CameraType.Custom
else
humanoid.CameraOffset = Vector3.new(0,0,0)
animate:Fire(argument, "outside")
local currentCamera = workspace.CurrentCamera
currentCamera.CameraType = Enum.CameraType.Scriptable
local tween = tweenService:Create(currentCamera, TweenInfo.new(0.5), {CFrame = cframe})
tween:Play()
task.wait(0.5)
currentCamera.CameraType = Enum.CameraType.Custom
end
end
end)
I also have this video to show.