Attempt to index nil with ToWorldSpace

Using a model for FastCast module and I’m getting the error attempt to index nil with ToWorldSpace. Any answers would be appreciated!

		local bulletLength = bullet.PrimaryPart.Size.Z/2
		local offset = CFrame.new(0, 0, -(length-bulletLength))
		bullet:SetPrimaryPartCFrame(CFrame.lookAt(lastPoint, lastPoint+direction)):ToWorldSpace(offset)

I think you had a parenthesis misplacement, try this on the last line
bullet:SetPrimaryPartCFrame(CFrame.lookAt(lastPoint, lastPoint+direction):ToWorldSpace(offset))

Thanks! That worked!
–Minimum character limit