Unstable GravityRadial

I am using a draggable gravityradial for something I want to make, but for some weird reason the gravityradial becomes unstable and starts moving around...

I set the Y gravity of the World to 2, X to 0.

I did that because i wanted to make a magnetic orb. [with limited reach]
but for some reason the gravityradial takes over all the gravity..

unless you know how to properly do that, lets talk about my question:

why is the gravityradial so unstable >> why does it move around all the time?

view here: http://coreper.110mb.com/test/UnstableGravityRadial.swf
source: http://coreper.110mb.com/test/UnstableGravityRadial.fla
GravityRadial extends Gravity

look into Gravity, look for sensorName.
if you provide the instance name of a sensor, it will only become the customGravity(take over gravity) of objects that are in contact with that sensor.

if no sensorName is found, it will become the customGravity of all objects.

alternatively in my own code i used an override on the create function to tell it to just make its own sensor, at the GravityRadial using the size of the GravityRadial, and also not setting visible=false. since like you i wanted something like a magnetic orb. it's a bit easier to design levels when it makes its own sensor.

in your case since you want it to move around. i recommend setting it to Kenomatic or something, so its not effected by other gravities (at least i assume that is what you want)
thanks for the attempted help, but i already gave up on Box2D, as it is way too complex...
Is setting the sensor name in the gravity really all you should have to do? I'm doing that, but when my body enters the sensor, the gravity does not seem to be properly applied. I put trace statements in the 'handleBeginContact()' and 'handleEndContact()' in Gravity.as, and those parts of the code are being hit as expected. The gravity just never seems to be properly applied. Am I missing some flag that I'm supposed to set?

Thanks,
Brian
Hey blachniet

Can you describe how the radial gravity IS behaving? It sounds like you're almost there since you're getting some effect, just not the effect you want. Post a SWF if you can.

Original thread: https://box2d.org/forum/viewtopic.php?t=6557