Argument 3 missing or nil whever i try to lerp angles?
Asked by
4 years ago Edited 4 years ago
So I made this script that whenever the game runs it will make the part face another part using linear interpolation (CFrame:Lerp()), but whenever I put the 2nd part's CFrame.p inside the CFrame.angles() it says "Argument 3 missing or nil", here is the script I'm using:
01 | Part 1 = game.Workspace.Part |
02 | Part 2 = game.Workspace.Part 2 |
07 | print (Part 2. CFrame.Position) |
08 | Part 1. CFrame = Part 1. CFrame:Lerp(Part 1. CFrame * CFrame.Angles(game.Workspace.Part 2. Position), 0.01 ) |
The output reads:
1 | 33.4099998 , 11.6699696 , - 83.8799973 |
2 | 14 : 27 : 19.557 - Argument 3 missing or nil |
3 | 14 : 27 : 19.557 - Stack Begin |
4 | 14 : 27 : 19.558 - Script 'ServerScriptService.Script' , Line 10 |
5 | 14 : 27 : 19.558 - Stack End |
Is it a newbie mistake, because i put a wrong value or something else? thank you!
EDIT: What I did to fix this was do Part1.CFrame = Part1.CFrame:Lerp(CFrame.new(Part1.CFrame.p, Part2.CFrame.p), 0.01)
instead of Part1.CFrame = Part1.CFrame:Lerp(Part1.CFrame * CFrame.Angles(game.Workspace.Part2.Position), 0.01)