How to make CFrame animations?

Hello , i was wondering if there’s any ways to make a cframe animation
for exemple , i’d want my character to T-pose

Thanks.

3 Likes

Are you sure you want to use c-frame? Animations may be a better option for you.
This post might be what you’re looking for if you want to make an animation.

2 Likes

Well i know that way but , was wondering if we could use something like CFrame to make small animations.

1 Like

Yes, you can do it via TweenService.

You’re better off doing it by animations however, its much easier since that’s what its intended purpose.

1 Like

You can, you just set the CFrame as implied?
Perhaps you’d want to check out Animations instead.
Not quite sure what you’re asking…

1 Like

He might be asking the proper way to animate using CFrame in for loops. They’re common in older models such as SCPF doors.

1 Like

If you want to get your character to T-Pose, you can use the Motor6D’s transform property. In order to manipulate that specific property, you can do

Motor6D.Transform = Motor6D.Transform * CFrame.Angles(0,0,math.rad(90))
--This would rotate the right arm up sideways.

To get the character to T-Pose, you could write something like this, making use of the lerp function:

for i=0,1 do
    Character.RightUpperArm.RightShoulder.Transform = Character.RightUpperArm.RightShoulder.Transform:Lerp(CFrame.new()*CFrame.Angles(0,0,math,rad(90)),i)
    Character.LeftUpperArm.LeftShoulder.Transform = Character.LeftUpperArm.LeftShoulder.Transform:Lerp(CFrame.new()*CFrame.Angles(0,0,math,rad(-90)),i)
end

In order to get the arms back down again, it is exactly the same, but instead of lerping to CFrame.new()*CFrame.Angles(0,0,math.rad(90)), you would lerp it back to the default CFrame position: CFrame.new().

for i=0,1 do
    Character.RightUpperArm.RightShoulder.Transform = Character.RightUpperArm.RightShoulder.Transform:Lerp(CFrame.new(),i)
    Character.LeftUpperArm.LeftShoulder.Transform = Character.LeftUpperArm.LeftShoulder.Transform:Lerp(CFrame.new(),i)
end
6 Likes

Yes there is, though I’m not going to spoon feed you the code for it. Have a look into Motor6D.Transform (linked in the post above mine).


Animations are just relative CFrames stored in key poses. Anything that can be done with the Animation Editor can also be done manually through scripts via editing the Motor6D Transform property.


Not quite sure that’s it. I mean, TweenService is basically the successor to using numeric for loops with CFrames to “tween” and a T-Pose wouldn’t really require any movement except positioning the arms to it.

Also, don’t think anyone knows what you mean when you say “SCP doors”. :wink:

1 Like

Bad advice, use CFrame:Lerp() instead for animating with Motor6D.

2 Likes

TweenService can be used on Motor6D properties the same way it is capable of tweening other properties towards a specified goal. It’s not appropriate to call someone else’s advice “bad” without providing a rationale for saying so. TweenService can accomplish what Lerp can.

2 Likes

And more: easing style; easing type; and time control. @rawbyte TweenService is more powerful than lerp is some sense because of the presets for things like easing styles and others.

2 Likes

It’s possible, but Motor6D Transform doesn’t replicate, which makes procedural animation cumbersome. You’d have to run the code on Stepped, and on every frame where you want the pose to override whatever the character’s animator is trying to make them do. This is why it’s much easier to just make 1-frame animations and play them with action priority, weighting of 1.

2 Likes