I am currently making a custom tool system, this means I have to weld or rig the tools to the character on my own, but after going for Motor6Ds, I remembered about the two CFrame properties it has.
When working on CFrame manipulation with welds or rigs, I’ve always been confused about the proper usage of C0 and C1, I know that C0 is the offset of Part0 while C1 i the offset of Part1, logically I could use either of the two for anything, but I keep questioning myself whenever I encounter this. Which CFrame property should I actually use? This may depend on the use cases I assume, like CFrame animations, rigging, etc.
I don’t have a concrete answer for this, searched through the forum but just found the differences between C0 and C1, which I already know.
I take opinions on what you consider the “best practice”, so anything goes! Hoping to receive any help here
Just like the motor6ds you see in the player’s character, the humanoidrootpart is part0 and the other body parts such as the arms or head are part1. Because the humanoidrootpart is the core/main part of the character, and the arms, legs, and head are just body parts you’re attaching to it.
C0 automatically offsets the CFrame of basepart that you selected as part0
Oh yes, I take that in consideration whenever I use motor6Ds or welds, the problem is that I don’t know what CFrame property to change whenever I am trying to manipulate the position or movement of the linked objects, I know they execute differently but I wish to know what would be the best thing to use with the context of making custom CFrame animations or just rigging. I appreciate your answer nonetheless.
cc @TheGameMaker178
As I said, I already know the difference between both, but I seek guidance for best practices. While rigging this raises my question, as both function similarly (although are not completely the same), this is why I want to know what would be considered, in anyone’s opinion, the best usage of these.
Although, motor6ds and welds basically have the same functionality. Motor6ds allow animations to be played on the selected baseparts (welds/weldconstraints do not), which is why they are used instead of welds.
I know the difference for both, the example I provided mentioned rigging, which uses Motor6Ds. As you said, welds and Motor6Ds have similar functionality, which is why I mentioned both earlier regarding my problem.
As it’s said in the title of this post and also previously said many times, I wish to know the best practices regarding the usage of C0 and C1 offsets.
Accessories aren’t for decoration only you know, it’s to attach something to the character. Unless you’re planning to animate the tool itself on the character hand (like moving or rotating it) then there is no need to use a motor6D.
Assuming that the Hand is Part0 and the Tool part attached to the hand is Part1, I would recommend setting C0 equal to the CFrame of the GripAttachment which is a child of the hand. And I would recommend setting C1 such that C1.Position equals the tool part local space position where the GripAttachment should be.
Basically, I would recommend keeping C1 constant and adjusting C0 based on GripAttachment CFrame. If you are unsure what should be the value of C1, you can add an attachment to the tool part, move the attachment (using studio tools) to the point where the tool is supposed to be attached to the hand, rotate if necessary and then set C1 equal to the CFrame of the attachment.
Alright, so to anwser your original question, there is no best practice for it.
C0 is the offset of Part0 from Part1.
C1 is the negative offset of Part0 from Part1.
C0 is added to Part0 CFrame, C1 is subtracted from Part0 CFrame.
It mean, C0.Position.X = -5 is equal to C1.Position.X = 5
Anyway, both C0 and C1 offsets the Part0 CFrame relative to part1.
Now choosing how to manipulate them is only up to you, you can use only one as well as using both, it remain the same.
There is no requirement for it, by default the motor6D offset the part0 CFrame, but if one of the part is anchored or is affected by another motor6D then it will offset the only part available to move… so it doesn’t matter if you set the hand/tool as part0 or part1, both will move the tool part as it is the only one that is not anchored and not affected by another motor6D.
The only difference between C0 and C1 is that C0 is a positive offset and C1 is a negative offset substracted to C0, otherwise both do the exact same thing which is to move the available part to a negative or positive direction.
Like i said: C0.Position.X = -5 is equal to C1.Position.X = 5, using only one or using both is only up to your preferences.
--Do you prefere this
Motor6D.C0 = CFrame.New(vector3.new(-5, 0, 5))
--or this
Motor6D.C0 = CFrame.New(vector3.new(0, 0, 5))
Motor6D.C1 = CFrame.New(vector3.new(5, 0, 0))
Yes, you can indeed choose Part0 and Part1 the opposite way and the tool part will still be the one that is moved (because the hand is more directly connected to the assembly root part). I mentioned the assumption because if he swaps Part0 and Part1, he’ll also need to swap C0 and C1. So my C0 and C1 advice was based on the assumption that hand is Part0 and tool part is Part1.
You are right that you don’t need to set both C0 and C1. However, these don’t exist as separate properties for no reason. When you have a tool that any character should be able to hold, you probably want every character’s hand to be attached to the same location in the tool’s local space.
However, because characters may be scaled differently, the position of the tool in the hand’s local space should depend on the size of the hand. If you want to only use C0 or C1, you can do one of the following every time a new character equips the tool:
There’s also another advantage if you are using a Motor6D and you want to animate the tool’s offset from the hand. The Motor6D property Transform is the property that Roblox animations use and that is also recommended to be used for scripted animations (updating it is more performant than updating C0 or C1 and allows you to animate without messing with offsets that should stay constant). You’ll most likely want to animate the tool’s offset relative to the grip attachment position. If you only set C0 or C1, setting Transfrom will animate it relative to either the Hand position or the tool part position. So that’s another reason why I recommend setting both properties.
Motor6Ds between character body parts also have both C0 and C1 set so that the rotations defined by animations happen around correct points.
From the name of your topic and reading it fully like me and @Crygen54 have, you are doing the “best practice” or “proper usage”. C0/C1 are only used to offset baseparts by CFrames in an assembly.
That’s all, there is no best practice. There is no secret way you should be doing it.
I’m not defaming @Conejin_Alt’s solution because it’s good. But, unless you were implying something else. From reading your topic name and everything you are already using C0/C1 properly.