How to tween a players camera into the Custom Cameratype

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I am trying to create an effect where a players camera tweens to a part, and then tweens back into the custom camera position. The issue is that the player is able to move around while the camera is in the tween.

  2. What is the issue? Include screenshots / videos if possible!
    The issue is that the player is able to move around while the camera is in the tween.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have tried saving the cameras position and making the tween faster, but you can still tell that the camera sort of teleports at the end

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

-- This is an example Lua code block

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

If you don’t want the player to move during the tween, you can put this in your tween code.

game:GetService("Players").LocalPlayer.Character.Humanoid.WalkSpeed = 0 -- tween starts, stops player from moving
game:GetService("Players").LocalPlayer.Character.Humanoid.WalkSpeed = 16 -- Tween ends, Back to regular walkspeed

I don’t know how you are controlling the camera flight to the part and back again. I do a similar thing and use tweens to control it. For the return to the player, I simply set the camera tween destination as the characters HRP Cframe:

	camera.CameraType = Enum.CameraType.Scriptable
	local tween = TweenService:Create(camera, tweenInfo, {CFrame = player.Character.HumanoidRootPart.CFrame})
	tween:Play()

No, it won’t be a perfect transition back to it’s original locaiton and yes, the player can move in the period the camera tween plays.

I used this and it works fine for me

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.