of     1   

xiaoxiao181
#181892618Monday, January 18, 2016 1:40 AM GMT

This is what I wrote so far, but I it's erroring so obviously i'm doing it wrong. script.Parent.Rot.Changed:connect(function() local A, B, Rot = script.Parent.A, script.Parent.B, script.Parent.Rot local PA = CFrame.new(A.CFrame + Vector3.new(0, (A.Size.Y/2 + 0.2) + B.Size.Y/2, 0)) B.CFrame = CFrame.new(PA) * CFrame.Angles(0, math.rad(Rot.Value), 0) end) The idea behind it was supposed to be that I'm creating a fake knee without additional parts except the shin and the thigh. Using CFrame to create a pivot point for the shin to create a cframe animation. What am I doing wrong, and how do I fix it?
xiaoxiao181
#181892832Monday, January 18, 2016 1:42 AM GMT

19:43:18.916 - Workspace.Model.Script:4: bad argument #1 to 'new' (Vector3 expected, got CFrame) 19:43:18.916 - Script 'Workspace.Model.Script', Line 4 19:43:18.917 - Stack End except that i did use a vector3
xiaoxiao181
#181894344Monday, January 18, 2016 2:00 AM GMT

script.Parent.Rot.Changed:connect(function() local A, B, Rot = script.Parent.A, script.Parent.B, script.Parent.Rot B.CFrame = (A.CFrame + Vector3.new(0, A.Size.Y/2 + B.Size.Y/2 + 0.2, 0)) * CFrame.Angles(math.rad(Rot.Value), 0, 0) end) Works kinda. I got it to stay in place like a real leg, but the shin merely rotates in place rather than pivoting like a joint. I'm just not getting the math right.
xiaoxiao181
#181896165Monday, January 18, 2016 2:22 AM GMT

I feel like I need to CFrame the shin by offsetting it from the thigh by half the thigh's size.Y/2, rotate, then offset it again from it's new position by the shin itself's size.Y/2 It sounds logical to me but i don't know how to do that. So far everything I've done that i havent posted either gives me the same results or causes the shin's cframe to position it in wild locations around workspace.
xiaoxiao181
#181898020Monday, January 18, 2016 2:45 AM GMT

script.Parent.Rot.Changed:connect(function() local A, B, Rot = script.Parent.A, script.Parent.B, script.Parent.Rot B.CFrame = (A.CFrame + Vector3.new(0, A.Size.Y/2 + 0.2, 0)) * CFrame.Angles(math.rad(Rot.Value), 0, 0) B.CFrame = B.CFrame + Vector3.new(0, B.Size.Y/2, 0) end) This is my newest attempt and this is the only thing that makes any sense to me but it isn't working. The shin is still rotating in one spot. It's not pivoting at all.
xiaoxiao181
#181898832Monday, January 18, 2016 2:56 AM GMT

script.Parent.Rot.Changed:connect(function() local A, B, Rot = script.Parent.A, script.Parent.B, script.Parent.Rot B.CFrame = (A.CFrame + Vector3.new(0, A.Size.Y/2 + 0.2, 0)) * CFrame.Angles(math.rad(Rot.Value), 0, 0) B.CFrame = B.CFrame * CFrame.new(0, B.Size.Y/2, 0) end) nailed it. lol... ty for all the help. you people are so amazing.
NickyJ3
#181898954Monday, January 18, 2016 2:57 AM GMT

I'm sorry. If I could script advanced things, I would help you. ~Storm~
xiaoxiao181
#181898955Monday, January 18, 2016 2:57 AM GMT

script.Parent.Rot.Changed:connect(function() local A, B, Rot = script.Parent.A, script.Parent.B, script.Parent.Rot B.CFrame = (A.CFrame * CFrame.new(0, A.Size.Y/2 + 0.2, 0)) * CFrame.Angles(math.rad(Rot.Value), 0, 0) B.CFrame = B.CFrame * CFrame.new(0, B.Size.Y/2, 0) end) Fixed. I was using vector, not cframe. that was my problem.
xiaoxiao181
#181899001Monday, January 18, 2016 2:58 AM GMT

lol don't worry john. i'm just being sarcastic

    of     1