Critical dynamics in trapped particle systems