Camera Part Not Animating?

Everytime I play this animation it plays for the player rig but whenever the camera is set to the camera model it just falls over? I’ve tried anchoring the hrp and unanchoring everything else but then it just stands still? (also set the primary part to hrp)

here are my scripts

Module Script:

local animPlayer = {}

local rs = game:GetService("RunService")

local animFolder = script.Parent
local humAnimation = animFolder:WaitForChild("Hum")
local camAnimation = animFolder:WaitForChild("Cam")

local camRig = animFolder.Parent:WaitForChild("CameraRig")


function animPlayer:PlayAnimation(char: Model)
	
	local hum = char:FindFirstChildOfClass("Humanoid")
	local animator = hum:FindFirstChildOfClass("Animator")
	local hrp = char:FindFirstChild("HumanoidRootPart")
	
	hum.WalkSpeed = 0
	hum.JumpPower = 0
	hum.AutoRotate = false
	
	local camRig = camRig:Clone()
	local camPart = camRig:FindFirstChild("Cam")
	local camHRP = camRig:FindFirstChild("HumanoidRootPart")
	local animatonController = camRig.Cam:FindFirstChildOfClass("AnimationController")
	local camAnimator = animatonController:FindFirstChildOfClass("Animator")
	camRig.Parent = workspace
	
	local humtrack = animator:LoadAnimation(humAnimation)
	local camTrack = camAnimator:LoadAnimation(camAnimation)
	
	camRig:PivotTo(hrp.CFrame)
	
	local weld = Instance.new("WeldConstraint")
	weld.Part0 = hrp
	weld.Part1 = camHRP
	weld.Parent = camHRP
	
	local cam = workspace.CurrentCamera
	
	cam.CameraType = Enum.CameraType.Scriptable
	
	local connection: RBXScriptConnection = rs.RenderStepped:Connect(function()
		
		cam.CFrame = camPart.CFrame
		
	end)
	
	humtrack:Play(0)
	camTrack:Play(0)
	
	task.wait(humtrack.Length)
	
	camRig:Destroy()
	
	connection:Disconnect()
	
	cam.CameraType = Enum.CameraType.Custom
	
	hum.WalkSpeed = 16
	hum.JumpPower = 7.2
	hum.AutoRotate = true
	
	
end

return animPlayer

Local Script:

local rs = game:GetService("ReplicatedStorage")
local cinematicAnimations = rs:WaitForChild("CinematicAnimations")
local example1 = cinematicAnimations:WaitForChild("Example1")
local animPlayer = require(example1:WaitForChild("AnimPlayer"))

local plrs = game:GetService("Players")
local lp = plrs.LocalPlayer
local char = lp.Character or lp.CharacterAdded:Wait()

local cutsceneTrigger = workspace:WaitForChild("CutsceneTrigger")

local cd = 10
local db = false

cutsceneTrigger.Touched:Connect(function(touched)
	if touched.Parent == char and not db then
		
		db = true
		
		animPlayer:PlayAnimation(char)
		
		task.wait(cd)
		
		db = false
	end
end)

Also ask if anybody needs my workspace or properties panel.

Might be a dumb question but do you set the camera CFrame to the one of a part or just tween the camera directly?

I’ve been using an animation I made in moon animator to move the part

Is that specific part anchored? If not, make sure it is. Although i’m not really familiar with how moon animator handles moving parts.
Something else you can do is weld it to the humanoidrootpart

why do you have to be so mean about this? like “sorry for the crashout” then don’t write it at all? you’re over here insulting the code i put here while obviously you need to learn a few things yourself.

It’s not even about the script. I’m just surprised by how people can get away by acting so childish on a forum meant for helping people. No need to call people “stupid” or “dumb” Just kindly explain the solution so they wont keep

I wasn’t saying you needed to learn anything scripting-wise, I was referring to your manners.

can you please stop responding if you aren’t going to contribute to this post at all?

I’m already working on the solution

1 Like

Hey, sorry that this guy was toxic to you. I’m pretty sure they don’t understand that the devforums are made for people to get help, or to help people in a good and respectful environment.
I feel as they do this a lot, it’s the 2nd post i speak in where they act like this so please know that it’s not just you. You are welcome to post any issue you have on here and that forever

Thank you, I did end up tweening the camera instead.

1 Like

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