I've tried adding scrollto behavior to two objects but it doesn't make it work like it should, because if one of them keeps going in a certain direction the camera won't work properely and both characters can't be seen. Is there an example of this anywhere or any idea on how this is accomplished successfully?
Develop games in your browser. Powerful, performant & highly capable.
It seems it does work, but when your characters are further away from eachother than the viewport width and the camera is in the center, you obviously won't see them..
You could either limit the movement of the characters or add a zoom function for when they are further apart..