Is it possible to keep an object upright inside another game object that is spinning or rolling

An example would be like a pet hamster ball where ball rolls however game object or hamster remains strait and upright. So far any object I put roll or spins with object even if rotation on rigidbody is locked.

object that rolling: A

object that should keep upright: B

solution 1: detach B from A and attach A and B to some empty C, move C, rotate A, B will be moved but not rotated

solution 2: make simple Update() in B and set it’s rotation every frame