Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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

Thhat is also not what lerp is for


woof woof

3 comments

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....

0

I did call CFrame.new

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.