How do I remove this automatic smooth tweening of the CurrentCamera Custom CameraType?

I want the player’s camera to be at their character instantly but when I use the Custom CameraType to make their camera automatically go to their character I have encountered this very annoying problem where it automatically tweens the camera while it goes there and glitches out for a bit too, this is all done by Roblox, below is an example of what I’m talking about:

As you can see in the GIF Roblox automatically smoothly tweens the camera when I select the Custom CameraType and my character glitches during it too and I don’t know what to do about it so is there any solutions to this?

Here’s the code that I’m using it’s very simple:

game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom

It’s a local script, I have also tried to get around this by manually setting their camera’s CFrame to be the HumanoidRootPart’s CFrame so it can go instantly to the player but unfortunately that didn’t work either…

game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
game.Workspace.CurrentCamera.CFrame = game.Workspace:FindFirstChild(tostring(game.Players.LocalPlayer)).HumanoidRootPart.CFrame

That’s all I have tried to fix this problem, I seriously need help with this problem because it’s very annoying and it glitches the camera for a bit, any help is appreciated. :slightly_smiling_face:

3 Likes

Well I encourage You To Watch This Video It can be very useful for you!

1 Like

Hello!
Make you sure you using local script and do this?

repeat
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
until game.Workspace.CurrentCamera.CameraType == Enum.CameraType.Scriptable
game.Workspace.CurrentCamera.CFrame = workspace.Part.CFrame
-- Part for undo this action is
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom

I hope it helps!

1 Like

That video doesn’t help with that, it doesn’t even explain this at all.

1 Like

That is exactly what I’m doing but it didn’t work, take a look at the scripts inside of the post above again.

1 Like

You’re doing it custom not scriptable
Do it scriptable

Could you explain what exactly differs your script from mine?

I don’t see a difference, turning their CameraType into Scriptable will break their camera.

As @vojta1587 said, you need to set the cameratype to Scriptable during the tween and when the tween finishes set it back to custom.

Turning the cameratype to scriptable makes you fully control your camera with the script you are using, if you set it to custom you won’t be able to control it properly as it is overriding with the default camera scripts.

Yep I agree it’s how he is saying

I still don’t understand how that will fix my problem thought, I’m not trying to make custom adjustments to their camera but instead I’m just simply trying to remove the annoying automatic Roblox smooth tween that happens if you set their CameraType to Custom.

I don’t have a tween that does this it’s Roblox doing it so if I set their CameraType to Scriptable their camera will break and if I set it to Custom back then it will still glitch out and do the automatic smooth tween again which is done by Roblox and not me so what I have done is basically useless…

When I set my camera type to custom I do not have a tween going on, and as I can see from your video, when you click the button the tween plays to the part and your character seems to have moved there too so it is not Roblox doing anything here as far as I know.

By the way, where is your local script parented to?

Roblox is don’t making any changed for tween or camera type change
Probably you got some camera script already that’s is breaking your script
Local script should be parented to the StarterGui
Also try debugging it like

Tween.Completed:Wait()
print(game.Workspace.CurrentCamera.CameraType,game.Workspace.CurrentCamera.CFrame)

This can help you if some of your script changes a CurrentCamera Property if yes try find that script
You can find it easily with pressing Ctrl+shift+f and search “CurrentCamera” That will show you all scripts that is working with Camera

If I’m correct I assume you’re dealing with the camera smoothing that roblox does while the “Custom” CameraType is set. Try something like this:

workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable --Allows full control of the camera
workspace.CurrentCamera.CFrame = CFrame.new(0, 0, 0) --Put your CFrame here
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom --Put it back to normal

If your camera is already set to “Scriptable” kind of like what you have in your video then do something like this to instantly reset it’s CFrame to wherever the character is:

workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
1 Like

Well that what we say him but he said it only broke the camera broke so I don’t know

If done correctly, it shouldn’t break as I’ve tested the code that I sent. If you or the OP have questions, feel free to ask them :slight_smile:

I have tried all of the solutions above but nothing worked, I have tried to fix it on my own by adding a wait() after the teleportation and then manually setting their CameraType to Custom and then I got this result which is way better than before:

This still breaks the camera for a second but it’s still way better than before, if I don’t find a solution then I will find my way around how I could make it a bit better but I still need help on fixing this.

Do you mind sending your code?

The only code that I can provide you other than the ones that are with my post is this:

plrCharacter.HumanoidRootPart.CFrame = game.Workspace:WaitForChild(thingtoteleporto).CFrame + Vector3.new(0,5,0)

plrCharacter is a reference to the player’s character in the Workspace, I don’t think that you knowing how I teleport them will change anything thought, the problem will most likely still remain, other than that code there’s nothing that I think is causing this.

I just want to know how to remove the automatic smooth tweening that is done by Roblox when you set their CameraType to Custom like I said in the post.

Show us all of your code that is related to this problem, we don’t only want 1 line.