The two variables that affect the gravitational force between two objects are

Mass and distance
Density and speed
Mass and speed
Velocity and distance

The two variables that affect the gravitational force between two objects are mass and distance.