CameraSubject dont work at high altitude

Hello, I have encountered an error that does not allow me to make a teleport effect, the error is that when the character is at a high altitude, the CameraSubject does not switch properly to the part.

I will be grateful for your help

["Teleport"] = function(plr,pos1,pos4)
		
		local Char = plr.Character
		local Eff = RS:WaitForChild("Effects"):WaitForChild("TpPart"):Clone()
		
		local pos2 = pos1 + Vector3.new(0,300,0)
		local pos3 = pos4 + Vector3.new(0,300,0)
		
		local ColSeq = CheckColor(plr) -- trail color
		
		Eff.Position = pos1
		Eff.ParticleEmitter.Color = ColSeq
		Eff.Parent = workspace.Other

		if plr == Players.LocalPlayer then Camera.CameraSubject = Eff end

		Char.HumanoidRootPart.Anchored = true
		Char:MoveTo(Vector3.new(0, -50, 0))
			
		for i=0,3,RunService.Heartbeat:Wait()do
			Eff.Position = cubicBezier(i/3, pos1, pos2, pos3, pos4)
			RunService.Heartbeat:Wait()
		end
		
		Char:MoveTo(pos4 + Vector3.new(0,5,0))
		Char.HumanoidRootPart.Anchored = false

		if plr == Players.LocalPlayer then Camera.CameraSubject = Char.Humanoid	end

		Eff.ParticleEmitter.Rate = 0		
		Debris:AddItem(Eff,2)
		
	end,
1 Like

Define the camera first as the CurrentCamera.

local Camera = workspace.CurrentCamera

This has already been done outside the function

First define Eff… then clone it in a separate variable, not on the same line you define Eff.

Instead do this:

local EffOriginal = RS:WaitForChild("Effects"):WaitForChild("TpPart")
local Eff = EffOriginal:Clone()

Edit: sorry was on phone, i corrected the formatting and casing.

There is no difference in this

Any errors in the output? . . .

1 Like

You can see everything in the video

1 Like

That’s strange. Maybe try selecting the TpPart and see where it is?

1 Like

I checked, it flies correctly (This is very strange)

It could also be because of this, maybe you’re deleting it too early and it becomes nil?

lol, it’s 100% not because of that

I found my mistake. In fact, that shop upstairs just dropped my camera every time I went out of its zone XD (sorry everyone)