Below is some code that numerically solves a 2D lossless ballistic flight. r[t] is essentially {x[t],y[t]} as a 2-vector. I try to stop integration when the projectile hits the ground as given by r[t][[2]]<0, but WhenEvent does not seem to recognize the syntax. Is there something wrong with my code?
eqs = {r''[t] == -{0, 1}, r'[0] == {2, 3}, r[0] == {0, 0},
WhenEvent[r[t][[2]] < 0, "StopIntegration"; tf = t]};
sol = NDSolveValue[eqs, r, {t, 0, 8}];
Plot[{sol[t][[1]], sol[t][[2]]}, {t, 0, 8}]