How to extrapolate camera CFrame from known offsets?

edited because I accidentally posted before I was finished lol

I’m using Moon Animator to animate a cutscene, which involves moving the camera around the player. The CFrame of the camera every keyframe is stored in a series of CFrameValues. To “play” the camera animation I run a RenderStepped function that sets the CurrentCamera CFrame to those values. However, because the CFrameValues are static the camera moves around where the character was rendered, and not where the character actually is.

I’m not good at CFrames, but I was thinking of taking the offset between the original (rendered) HumanoidRootPart and animated CFrames, then applying that offset with the new RootPart and animated CFrames. For example, if the original RootPart was at (1,1) and the camera was at (2,2) then if the RootPart was at (3,3) then the camera frame would be at (4,4). I’m sure changing the positions like that is on the right track but I don’t know how to maintain orientation along with it. Any help is appreciated!

1 Like

So do you want it to change the CFrame of the camera without offsets?

I want the CFrame of the camera to change relative to the HumanoidRootPart using an offset. I have the CFrame values of the camera relative to the original HumanoidRootPart CFrame, so if I were to change the HumanoidRootPart’s position the two values should still be relative to each other. I don’t know how how to get this relativity.

I’m not sure how you can do this because in my testing adding 2 CFrames together give this long stream of numbers.

image

Sorry I couldn’t help.

No worries, thanks for the attempt

you can use CFrame:ToObjectSpace() to get the offset between 2 cframes

edit: my guess is that moon animator uses the cframe values as an offset from the humanoidrootpart, so perhaps try multiplying the camera values by the cframe of the primary part/humanoidrootpart of the animated object?