Hey everyone, I am having a problem with manipulating my camera. In the script below, I was able to tween the camera to the correct position, but I don’t know how to get it back to the normal player view. (Keep in note, this game is in first person lock.) Any help appreciated. Thanks!
game.ReplicatedStorage.movecamera1.OnClientEvent:Connect(function(player)
local player = game.Players.LocalPlayer
local tweenService = game:GetService("TweenService")
local camera = game.Workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
local tweenInfo = TweenInfo.new(1.5,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0)
local tweenProp = {CFrame = game.Workspace.cameraposition1.CFrame}
local tween1 = tweenService:Create(camera,tweenInfo,tweenProp)
tween1:Play()
wait(3)
--I don't know what to do here and how to get back to player normal view.
end)
Have you tried creating a dummy-part, that you tween instead? Then you just set the CameraSubject to that part while tweening, but back to the character when finished?
Edit: You can also in addition tween a focus-part, this will be the point where the camera looks at.
You can create a dummyPart both for CameraSubject & Focus if you so desire, to achieve exactly the position & orientation & direction the camera is looking. You can also use the Part.LookVector as Focus, as far as I remember.
So, what will that do? Will it make the camera go back to the player. Don’t forget, I am trying to tween the camera CFrame back to the normal player view.
In this case, you’ll have to store the player’s last camera CFrame before tweening the camera, after, tween it back to the last camera CFrame value you stored, and when it finishes, set the camera type back to Enum.CameraType.Custom