# Simple Animation Help

I am just starting to try animating tikz pictures in beamer. As a test, I want to have a ball move to the right. Here is the code. Any suggestions would be greatly appreciated.

\documentclass{beamer}
\usepackage{tikz}
\usepackage{animate}

\begin{document}

\begin{frame}
\begin{animateinline}[loop]{10}
\multiframe{10}{rPos=0.1+0.5}{
\begin{tikzpicture}
\node[electron] (e) at (\rPos,1) {$e^{-}$};
\end{tikzpicture}
}
\end{animateinline}
\end{frame}

\end{document}


You need to set a common bounding box for all animation frames which encompasses all positions of the electron. Otherwise the animation's viewport moves with the electron.

\documentclass{beamer}
\usepackage{tikz}
\usepackage{animate}

\begin{document}

\begin{frame}
\begin{animateinline}[loop]{10}
\multiframe{10}{rPos=0.1+0.5}{
\begin{tikzpicture}
\node[electron] (e) at (\rPos,1) {$e^{-}$};