Joining two distinctly different physics bodies as one object

I’ve already read the documentation and tutorials regarding multi-element physics body, but none of them seem to help me resolve this issue.

Basically, I’m trying to combine objects with different physical properties so that forces can be applied on them as one unit while collision response is separate. Here’s what I mean. There’s a planet body that’s kinematic and a gravity field which is also kinematic, but it serves as a sensor around the body. Ultimately, I’d want to apply two forces: rotational force that spins the planet along its gravity and a linear velocity that would move them.

Here’s my first approach. I’ve tried weld joint, by attaching gravity field to the planet, but when linear velocity is applied on the planet, only the planet is moving without its gravitational field.

The second approach was to attach them by creating a display group called planet group then inserting the planet body and gravity field into the planet group, but I noticed that later on that I run into issues with the collision. 

I’d appreciate some help. Thank you in advance.

I think you might be trying to actually represent planetary bodies moving within realistic gravitational fields. That’s going to be very, very hard and the bodies will need to be a lot smaller than a game would allow for.

Having said that, if you can work out the orbits yourself then you can just move the objects with a touchjoint and they will go exactly where you want them.

Putting bodies into child groups is not a good idea unless all the child groups have the same 0,0 location. This is because all physics bodies have the same 0,0 location (top left) but display objects (which are tied to the bodies) have a relative 0,0 (the centre of their parent.)

I’m not sure if I get this properly from your first approach, but you could try attaching all the bodies together with a pivot joint and them moving them around each other with a motor. That’s actually fairly easy to do.

I think you might be trying to actually represent planetary bodies moving within realistic gravitational fields. That’s going to be very, very hard and the bodies will need to be a lot smaller than a game would allow for.

Having said that, if you can work out the orbits yourself then you can just move the objects with a touchjoint and they will go exactly where you want them.

Putting bodies into child groups is not a good idea unless all the child groups have the same 0,0 location. This is because all physics bodies have the same 0,0 location (top left) but display objects (which are tied to the bodies) have a relative 0,0 (the centre of their parent.)

I’m not sure if I get this properly from your first approach, but you could try attaching all the bodies together with a pivot joint and them moving them around each other with a motor. That’s actually fairly easy to do.