Location change of child as gaming mode activated I have two cylinders, one is the puck, other is the handle. The handle is child of the puck. They both have dynamic physics.
I use python to define their motion.
As soon as I hit p and enter gaming/testing mode, their locations are changed. But the handle has more dramatical location change than the puck.



Here is two photos of before and after hitting p:

Before:



After:



I cannot figure out why this sudden change of location and getting compressed in y direction.

Here is my script:

import bge


def main():
    cont = bge.logic.getCurrentController()
    scene = bge.logic.getCurrentScene()
    keyboard = bge.logic.keyboard
    puck = cont.owner


    # sensors
    bottom_edge_collision = cont.sensors["bottom_edge"]

    # keys
    r_pressed = bge.logic.KX_INPUT_JUST_ACTIVATED == keyboard.events[bge.events.RKEY]

    if r_pressed:
        scene.restart()
        print("rsrt", puck.localPosition)


main()


Here is my blend file:
https://drive.google.com/drive/folders/1dcXSZ7HHZH9h8f6KFJWUsVmuRl69o6bd?usp=sharing
Without seeing your blend file we can only guess. The most likely candidate is a non-unit scale. Select the objects, press CTRL+A and choose "Scale". This applies the object-level scale factor to the mesh itself, and resets the object-level scale to (1, 1, 1).