To do this you can simply use DrawDebugLine using the world locations of the two spheres as parameters.
I’ve set the duration to be 0 (it’ll need to be called every frame to be visible) so it’ll update with any change, but if you know how long it’ll be up on screen and don’t want it to change, you can change that duration to be whatever you need.
An easy alternative would be using a spline.
You can use as many points as you want, but to create a line you can just use two with the same rotation
Here’s a video explaining them:
Depends if the line itself is 2d or 3d. Browse this thread for options:
A ribbon particle could look and perform better than a Spline Mesh Component. But a SMC would give you more flexibility. What method to choose depends on what this is going to be used for.