Let $F : C \to E$ and $G : D \to E$ be functors. Consider the comma category $(F \downarrow G)$ with its projections $\pi\_1 : (F \downarrow G) \to C$ and $\pi\_2 : (F \downarrow G) \to D$. Using the elementary construction of a comma category, it is easy to prove the following equality: $$F \; \circ \; \pi\_1 \;\; = \;\; G \; o \; \pi\_2$$


However, a comma category can also be seen as a special case of weighted limit in the 2-category of 1-categories. How to prove the above equality by using the properties of a weighted limit? What else can we deduce about comma categories from the fact that they are weighted limits? 



Comma category as weighted limit
The equality you state is not true in general. An object $(c,f,d)$ of the comma category consists of an object $c$ of $C$, an object $d$ of $D$, and a morphism $f \colon Fc \longrightarrow Gd$ in $E$. The projection functors $\pi\_1$ and $\pi\_2$ send this object to $\pi\_1(c,f,d) = c$ and $\pi\_2(c,f,d) = d$, so we have $(F\circ\pi\_1)(c,f,d) = Fc$ and $(G\circ\pi\_2)(c,f,d) = Gd$, which are not equal in general. They will be equal if $E$ is discrete, in which case the comma category is the pullback.


What is true in general is that there is a natural transformation $\lambda \colon F\circ\pi\_1 \longrightarrow G\circ\pi\_2$. The component of $\lambda$ at the object $(c,f,d)$ of $F \downarrow G$ is the morphism $f \colon Fc \longrightarrow Gd$ in $E$. This natural transformation is part of the structure of the comma category as a weighted limit, as I will now spell out.


The limit of a $2$-functor $J \colon \mathcal{A} \longrightarrow \mathcal{B}$ weighted by a $2$-functor $W \colon \mathcal{A} \longrightarrow \mathbf{\text{Cat}}$ consists of an object $\{W,J\}$ of $\mathcal{B}$ together with a ''universal cylinder'', which is a $2$-natural transformation $W \longrightarrow \mathcal{B}(\{W,J\},J-)$ such that the induced composite functor
$$ \mathcal{B}(B,\{W,J\}) \longrightarrow [\mathcal{A},\mathbf{\text{Cat}}](\mathcal{B}(\{W,J\},J-),\mathcal{B}(B,J-)) \longrightarrow [\mathcal{A},\mathbf{\text{Cat}}](W,\mathcal{B}(B,J-))$$
is an isomorphism of categories.


(Note that if $\mathcal{A}$ is a category, then these $2$-functors and $2$-natural transformations just amount to functors and natural transformations respectively.)


Now let $\mathcal{A}$ denote the free category on the graph $\bullet \longrightarrow \bullet \longleftarrow \bullet$.The comma object $f/g$ of a cospan $f \colon A \longrightarrow C \longleftarrow B \colon g$ in a $2$-category $\mathcal{B}$ is the limit of the corresponding functor $J \colon \mathcal{A} \longrightarrow \mathcal{B}$ weighted by the functor $W \colon\mathcal{A} \longrightarrow \mathbf{\text{Cat}}$ that picks out the cospan $\bot \colon 1 \longrightarrow \mathbf{2} \longleftarrow 1 \colon \top$, where $\mathbf{2}$ denotes the free category on the graph $\bot \longrightarrow \top$. The universal cylinder for this weighted limit is a natural transformation as displayed in the commutative diagram 
$$
\require{AMScd}
\begin{CD}
1 @>\bot>> \mathbf{2} @<\top<< 1\\
@VpVV @VV\lambda V @VVqV\\
\mathcal{B}(f/g,A) @>>\mathcal{B}(1,f)> \mathcal{B}(f/g,C) @<<\mathcal{B}(1,g)< \mathcal{B}(f/g,B)
\end{CD}$$
in $\mathbf{\text{Cat}}$, 
which amounts to a $2$-cell $\lambda \colon fp \longrightarrow gq$ in $\mathcal{B}$ as in the following diagram.
$$
\require{AMScd}
\begin{CD}
f/g @>q>> B \\
@VpVV \Longrightarrow @VVgV \\
A @>>f> C
\end{CD}
$$


