Thats pretty easy vector math, just substract B from A, normalize it and multiply it by the desired distance. You also could use the Lerp(vector) node, divide the desired distance by the distance between A and B and use this value as Alpha.
You will need vector math very often when working on games so you may want to improve you skills in that field when you want to develop games.