Truck campers usually do charge from the truck while driving, but only very weakly.
That’s because the truck usually has small light-gauge wires to the connector plug, the plug itself is light duty, and the wiring in the camper is light duty.
The solution is to run much larger dedicated charge wires. I use 2-gauge, from the truck battery to the bed of the truck, to an Anderson 100-amp connector. Then I’ve got more 2-gauge going from the other half of the Anderson connector to my camper batteries.
You can control it however you like, from as simple as plugging or unplugging the connector when parked, installing a heavy duty solenoid, or a large isolator.
If you do this you’ll get great charging current to your camper. The stock wiring just can’t do it.