How much force needed?

I’ve got 2 bodies that I control with the accelerometer at different times.
BallA = Physics radius 7
BallB = Physics radius 17
I’m using this code to control ballA:

local xForce = (event.yGravity \* 16)  
local yForce = (event.xGravity \* 16)  
  
ballA:applyForce(-xForce, -yForce)  

Problem is here though, I want to move both objects at same speeds. But the larger a body gets the more force it needs, so how much more more force should I apply to ballB? Is it event.xGravity * 26? [import]uid: 30185 topic_id: 6879 reply_id: 306879[/import]

bumpty [import]uid: 30185 topic_id: 6879 reply_id: 24101[/import]

Bumps [import]uid: 30185 topic_id: 6879 reply_id: 24437[/import]

b [import]uid: 30185 topic_id: 6879 reply_id: 24646[/import]

For each 1 pixel in physics radius, how much should the force grow? [import]uid: 30185 topic_id: 6879 reply_id: 24647[/import]

last bump in hopes [import]uid: 30185 topic_id: 6879 reply_id: 25288[/import]

Remember that in a physics engine like Box2D, you’ll be applying force which does not control speed, it simply applies energy to an object in a given direction. If you want to work out how much energy to apply to make an object move, you’ll need it’s mass (density and size values can give you this) as well.

You’ve not provided the density or world gravity values in your post, which makes it almost impossible for anyone here to give you an answer. I certainly can’t as I have no training or education in multi-body physics. I would guess (no offence to anyone at all meant) that most people here are using Corona’s implementation of a physics engine because they want to avoid those kinds of calculations.

However, if you want to continuously move a physics object in a Box2D world, the recommended method is to use a Touch Joint. Try implementing this and mess about with the associated values of the joint (informative and fun), see here:

http://developer.anscamobile.com/content/game-edition-physics-joints#Touch_joint

Note: The process would involve a timer to move the joint along and fire setTarget on a regular basis, with a suitably tight force applied. This may give you what you want.

Good luck,

matt [import]uid: 8271 topic_id: 6879 reply_id: 25496[/import]

Thank you Matt. I’ll have a look at that! [import]uid: 30185 topic_id: 6879 reply_id: 25685[/import]