postfan said:
A unit vector is any vector whose magnitude is one (or
unity). That's the mathematical definition, but I'll explain what it is in the context of the problem as well.
You already know that you can take a vector ##\vec{A}## and decompose it into its three components ##A_x##, ##A_y##, and ##A_z## right? But you can't just say that $$A_x + A_y + A_z = \vec{A}$$, because then you have a scalar quantity on the left hand side of the equation and a vector quantity on the right, which doesn't make any sense. So that equation is wrong.
The proper equation is $$A_x \hat{x} + A_y \hat{y} + A_z \hat{z} = \vec{A}$$ ##\hat{x}##, ##\hat{y}##, and ##\hat{z}## are unit vectors, which means they all have a magnitude of one. So the way this equation works is that if you start at the origin, and then you add the vector ##A_x \hat{x}##, and then you add the vector ##A_y \hat{y}##, and then you add the vector ##A_z \hat{z}##, you get ##\vec{A}##! Does that much make sense?
##A_x \hat{x}##, ##A_y \hat{y}##, and ##A_z \hat{z}## are the component vectors of ##\vec{A}##, and ##A_x##, ##A_y##, and ##A_z## are the magnitudes of these component vectors. This is because the magnitude of the unit vectors is one, so when you multiply any number by them, the magnitude of the resulting vector is just the magnitude of the number. You can actually derive the equation for the magnitude of a vector from the above equation!
So what happened when you took the dot product of ##\vec{A}## and ##\vec{B}## is you actually performed $$A_x B_x \hat{x} \cdot \hat{x} + A_y B_y \hat{y} \cdot \hat{y} + A_z B_z \hat{z} \cdot \hat{z}$$ And then, since you know that ##\hat{x} \cdot \hat{x} = |\hat{x}| |\hat{x}| cos(\theta)##, and you know that the magnitude of ##\hat{x}## is 1 and the angle between them is 0 (because they're the same vector), then that just turns to 1! So your equation goes to ##A_x B_x + A_y B_y + A_z B_z##, which is what you're probably used to.