Animation Not Playing

So I wanted an Intro cutscene for my game. The characters camera would be set to a part, he blinks and stuff and then the game starts. But when his camera is just stuck facing forwards it looks weird. So i made a little animation in Moon Animator for the part but when I try play the animation it doesnt play no matter what. I tried playing the animation from the Server and Client but neither worked. No error message.

Edit: I looked for the server and the part is playing the animation. But the client isnt. It’s either the animation isn’t playing for the client, or the client’s camera isnt updating along with the part.

Server.

game.ReplicatedStorage.PlayCutscene.OnServerEvent:Connect(function(player)
	
	local IntroCamera = workspace.IntroCutsceneCam
	
	local Anim = IntroCamera.Humanoid.Animator:LoadAnimation(IntroCamera.Humanoid.Animation)
	Anim:Play()
	
end)

image

Try to fire remoteEvent to client and replicating the animation

I just double checked something, the animation does play on the client but the camera doesnt follow the part. It sticks to the CFrame it was put to and doesnt change despite me setting the camera subject to the part.

can u give me the script where you set the camera to the part

local EffectsUI = player.PlayerGui.EffectsUI
		
		local Vignette = EffectsUI.Vignette
		local BlackScreen = EffectsUI.BlackScreen
		
		BlackScreen.Visible = true
		Vignette.Visible = true
		
		task.wait(5)
		
		local PlayerCamera = workspace.CurrentCamera
		local IntroCamera = workspace.IntroCutsceneCam
		
		PlayerCamera.CameraType = Enum.CameraType.Scriptable
		PlayerCamera.CFrame = IntroCamera.IntroCutsceneCam.CFrame
		PlayerCamera.CameraSubject = IntroCamera.IntroCutsceneCam
		
		Tween(1, BlackScreen, TweenInfo.new(1), "BackgroundTransparency")
		
		game.ReplicatedStorage.PlayCutscene:FireServer(player)

This is a local script

IntroCutsceneCam is a Model, i think it’s preferable to set the CFrame equals to a Part CFrame

It is. IntroCutsceneCamera is a model and there is a part inside of it called IntroCutsceneCamera, I was going to change the naming after I figured this out. The CFrame is set to the Part CFrame

Oh now i see.
Btw can u provide a video of what’s exactly is going on?

I’ll try get one but whats happening is there is an anchored part which is the camera. The player’s camera is set to the ‘introcamera’. The introcamera plays an animation (which plays thankfully) however the players camera is not updating alongside the introcamera, so while the introcamera is playing the animation, the players camera is stuck on the first frame of the animation.

oh, now i understand, you should set the camera position in loop cause the part CFrame is constantly changing.
Or set the part as the camera primaryPart, but i’m not sure how it’s done

In a loop? Like a while true do one?

Yea, maybe create a variable that tells the script if the animation is still playing

You could even do: while the animation is still on, set the camera position

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