Camera automatically rotates at the end for no reason

Hey,

In the video fragment below I tried to do the GTA V camera spawning thingy where if you join, your camera comes from the sky to the player, because why not? :slight_smile:

Overall, it works. I just have this small issue at the last part of the system.

As you saw in the video, it works. But at the end, you see that the camera stops above the head of the player (which is normal) but then it rotates automatically? I didn’t script it so it rotates 90 degrees at the very end. At the end of the script, we’re destroying all the unnecessary things such as the client script (because we don’t need to use it anymore)

Camera Tweening:

--Functions
function Cutscene(Part1, Part2, CutsceneTime)
	Camera.CameraType = Enum.CameraType.Scriptable
	Camera.CFrame = Part1.CFrame

	local TweenInformation = TweenInfo.new(CutsceneTime, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0)

	local Tween = TweenService:Create(Camera, TweenInformation, {CFrame = Part2.CFrame})
	Tween:Play()
end

if Player.PlayerGui.Screen.Frame.BackgroundTransparency >= 1 and Player.PlayerGui.Screen.Frame.Label.TextTransparency >= 1 then 
	task.wait(0.5)
	Cutscene(DefinedPart.Cam1, DefinedPart.Cam2, 1)
	task.wait(1)
	Cutscene(DefinedPart.Cam2, DefinedPart.Cam3, 1)
	task.wait(1)
	Cutscene(DefinedPart.Cam3, Player.Character.HumanoidRootPart.CamPart, 1)
	task.wait(2)
	Sender:FireServer("Loaded")
	Camera.CameraType = Enum.CameraType.Custom
	script:Destroy()
end

The DefinedPart is the part where the player spawns at (in GTA V you always spawn in random parts of the map.)

Is there any fix for this?

Thank you in advance!

I have a feeling it has something to do with the Orientation but I’m just not sure. Here’s the CamPart script:

StarterPlayer → StarterCharacterScripts → Script

repeat wait() until script.Parent.HumanoidRootPart

local CamPart = game:GetService("ReplicatedStorage").CamPart:Clone()
local Weld = Instance.new("WeldConstraint", CamPart)

CamPart.CFrame = script.Parent.HumanoidRootPart.CFrame * CFrame.new(0, 15, 0)
CamPart.Size = Vector3.new(4, 1, 2)
CamPart.Transparency = 1
CamPart.Anchored = false
CamPart.Parent = script.Parent.HumanoidRootPart

Weld.Part0 = script.Parent.HumanoidRootPart
Weld.Part1 =  CamPart
CamPart.CanCollide = false
CamPart.Orientation = Vector3.new(-90, 0, 0)

if CamPart and Weld and script.Parent.HumanoidRootPart then 
	script:Destroy()
end
CamPart.Orientation = Vector3.new(-90, 0, 0)

Try:

CamPart.Orientation = Vector3.new(0, 0, + or - 90)

I’m not sure which way it’ll face but one will be flipped from the other so pick the one which is most suitable.

1 Like

The (0,0, + or - 90) is not possible, + and or gets red underlined because it’s not possible

Sorry, I should have clarified, try either 90 or -90, I’m not sure which way either will face but use the one which is most suitable. That’s what I meant by “+ or - 90”.

-90 will face down, 90 will face up.

Found a way to manipulate the camera (made it to Attach first and then set it back to Custom)

Anyways, thanks!