Hello! I’m writing a bit of CFrame math and this bit of code has been bugging me for a while. I’m writing a plugin if it’s of any help.
currentNodeSelected = Part -- the part exists and is generated by another bit of code. I added this in for simplicity and to show that it isn't nil.
trackPiece.CFrame = currentNodeSelected.CFrame + currentNodeSelected.CFrame.RightVector*currentNodeSelected.Size.X/2 + currentNodeSelected.CFrame.LookVector*trackLength.Size.Z
Then this error pops up (line 96 in the full code but here it’s line 2)
user_Sammy's Tracks.rbxmx.Sammy's Tracks.Main:96: attempt to index number with 'Size'
I swear it worked before. The error appeared after I changed this to the script:
currentNodeSelected.CFrame.LookVector*currentNodeSelected.Size.Z
to
currentNodeSelected.CFrame.LookVector*trackLength.Size.Z
I’m guessing I made a typo I just can’t see or did the CFrame math wrong as I’m still a bit new with it. Help is greatly appreciated!