Using parent to control child's position relative to the parent

Sorry if this is incredibly simple and I’ve just missed it . . . when I use standard WASD motions to move a parent object around, I want the child to stay with it (which it does, of course) but I also want to change the location of the child relative to the parent (localPosition). For example, the faster the parent object is moving, the further away I want the child object to be, and then as the parent slows down, the child comes closer again.

If this is possible, either through Python or logic bricks, I would very much appreciate your suggestions.

object.worldPosition=object.parent.worldPosition
object.worldOrientation=object.parent.worldOrientation
object.applyMovement((0,own[‘offset’],0),1)

Thanks. Would this script be attached to the parent object, or the child?

A keyword that might also help you with search is “slow parent”.

Parent

here is a example

Attachments

example.blend (445 KB)

Thanks! The example file was very educational. Much appreciated.