Is it possible to tween certain axises of a part?
Asked by
5 years ago Edited 5 years ago
Hello, I have a platforming game which involves the W,A,D keys to move it left, right, or up. The movement works just fine, but I want to tween it to remove the jerkiness of the cframe. I want to only tween the x and y axis and not the z, but I keep getting the resulting errors such as; "attempt to index field 'cframe' (a nil value)" and "x cannot be assigned to". Here is the script I am using for the tweening:
02 | cfgoal.CFrame = CFrame.new() |
06 | local tweeninfo = TweenInfo.new( 0.15 ) |
07 | local tween = tweenser:Create(workspace.Player, tweeninfo, cfgoal) |
09 | player.CFrame = CFrame.new(newX,newY,newZ) |
10 | camera.CFrame = CFrame.new(CameraX,CameraY,newZ + 19.25 ) |
12 | print ( "cur x - " .. cfgoal.CFrame.X) |
13 | print ( "cur y - " .. cfgoal.CFrame.Y) |
The newX and newY variables are listed above the code. Is there anyway I could possibly tween the x and y axises, and leave the z axis alone?
Also, the line the error comes from is on line 3 of this script.