Is it possible to parent character object to a rigid body?

I’d like to parent a character object to a rigid body which is in this case a vehicle and I’d like for the character to stay inside the vehicle.

If I parent the character object to a rigid body or a static object that’s already parented to that rigid body object, the character object goes haywire.

Is it possible?

I would think about some ‘movie magic’ and how you can end a actor, and spawn a new actor in his place in the same frame,

Basically, you need the player to be able to “get to his mark” and be swapped out with a pre animated double that is part of the car.

1 Like

Thank you for your suggestion.
That’s the way I have it set up already with that magic.

So there is no other way?

The problem I have is the sun light object that is parented to the character.

parent it to a empty, parent that to the player, when swapping, unparent the empty, stick it to the car.

you can also use

import bge
empty = bge.logic.getCurrentController().owner
rate = .5
empty.worldPosition = empty.worldPosition.lerp(empty['Target'].worldPosition, rate)

and change empties target on the fly

1 Like

Thank you for your suggestion.
It works but it seems that I can’t use an empty if I want to parent the light to a vertex.
So I had to use a polygonal object instead.