Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why is this lerp for the arm not working? [Short Script]

Asked by 8 years ago

So I am a bit new to lerping and I want to learn it for animation purposes after all they are really important in games.... However, it's not going so well for me I am trying to make it so that the part stays where it is at.... and then moves to someplace without teleporting to the middle of my torso because every time I access the shoulder inside of the Torso it teleports my arm to the center of the torso and I have been wanting to know how to do that thankfully someone answered me on a comment however, he didn't really explain it well so I was wondering why this script that I did won't work.... It's in the Command Bar(While the game getting Played)....

OUTPUT ERRORS:

17:26:55.230 - for per = 0.00, 1.00, .005 do wait() local RS = game.Workspace.Player.Torso["Right Shoulder"] RS.C0 = CFrame.new:lerp((RS.C0.p) * CFrame.Angles(1,1,1), per) end:1: attempt to index field 'new' (a function value)

This following script is what someone told me to do I just messed around with it a bit like adding the 'per'....

SCRIPT

for per = 0.00, 1.00, .005    do   
wait()     
local RS = game.Workspace.Player.Torso["Right Shoulder"]                
RS.C0 = CFrame.new:lerp((RS.C0.p) * CFrame.Angles(1,1,1), per)
end

I put all that into the Command Bar I would be thankful if you helped me out with this script it's really necessary for me to learn animations without them in my opinion games are just not fully complete.

1 answer

Log in to vote
1
Answered by 8 years ago

You didn't call CFrame.new on line 4.

Thhat is also not what lerp is for


woof woof
0
Well, if I want the arm to smoothly get lerped from the character's original arm position without the arm teleporting to the center of the torso How would I do that? If I wanted the arm to get smoothly lerped to the forhead by angles but, from it's previous position.... KingLoneCat 2642 — 8y
0
I did call CFrame.new KingLoneCat 2642 — 8y
0
You in fact did not. I can see it very clearly that you attempted to index lerp as a method of new, but new is a function and does not work with accessors. CailThePuppy 70 — 8y
Ad

Answer this question