I have 2 parts.
Imagine there will be a tiny part that connects between those 2 parts. Normally, you change the Part.Size.Y property in order to scale to make it look like the part is connecting those 2 parts. However, when I tried to do this CFrame manipulation:
It appears like this.
It appears the part’s Size.X direction is looking at the green part instead of Size.Y.
BUT, if I use the same code line and instead I made the part to look at PartB’s position after doing the Lerp function:
heres the Vector3 documentation, and go to functions. The first thing is Vector3:Lerp
i have no source but from 1 year experience in coding (and camera manipulation which uses CFrame), and literally in ALL CODING LANGUAGES, thats how that works.
Im not sure what you are thinking
a = 5
b = 7
a = (b - a) * a
print(a) -- 4? no 10
you dont set a to (b - a) then after that multiply a by itself.
you set a to (b - a) * a
I believe that’s just operator precedence, not things starting from the right, if so, can you explain why this returns 3?
print(true and 3 or 5)
The brackets have high priority than multiplication, so obviously Lua will first interpret whatever that’s inside the bracket before doing with the multiplications.
He doesn’t mean things start from the right. He means that everything on the right side of an equals is calculated before it is assigned to the value at the left side of the equals. The issue though is that you’re adding rotation instead of setting rotation in your first line of code and basing it off of the rotation of PartA and PartB. The second way of doing it would work since you aren’t adding rotations, but use Vector3.Lerp for this since it will be more efficient.
I misunderstood you. Here is how your code is interpreted.
It finds the CFrame that is halfway between (and halfway rotated between) A and B, and then ADDS the rotation of the second CFrame.new there. Then it assigns it to the property.
This code once again finds the position halfway between (and rotation halfway between) the two CFrame A nd B. It then however strips the existing rotation instead of adding onto it when you do part.Position