Question about Gravity

Jan 9, 2013 at 4:55 AM


I'm a student using physics helper for the first time. I've done a few things but now I'm having problems with gravity. I want to turn off gravity to create a block-out application.

I've tried setting the HorizontalGravity and VerticalGravity of the physics canvas to zero, but a ball I  create within the canvas still behaves as if gravity is acting upon it.

How can I turn off gravity within a physics canvas so that all objects within that canvas no longer act as if gravity as acting upon them?

Thanks for your help.

Jan 12, 2013 at 3:50 AM

Hello? Helloo?

Jan 12, 2013 at 10:06 PM

Hello :)

Please see this post, which shows setting gravity at runtime -


Jan 15, 2013 at 12:59 PM

I have tried to set GravityHorizontal and GravityVertical both zero.

But doesn't make any changes...

Jan 15, 2013 at 1:15 PM

Please be sure to set the properties on the Simulator, not the behavior. Note the red text below, it is using the Simulator object on the physics controller.

PhysicsControllerMain _physicsController = cnvGame.GetValue(PhysicsControllerMain.PhysicsControllerProperty) as PhysicsControllerMain;


Vector2 newVector = new Vector2();

newVector.X = 0;
newVector.Y = 10;

_physicsController.Simulator.Gravity = newVector;



Jan 15, 2013 at 1:22 PM

I try it now

Jan 15, 2013 at 2:23 PM


Is this C# plus xaml?

Which reference has PhysicsControllerMain?

Jan 15, 2013 at 3:11 PM

This forum is for the "original" Physics Helper for Silverlight and Blend, which uses Behaviors.

Perhaps you are using the "newer" Physiscs Helper XAML project from here - ??

If so, then you want to use the Simulator on the PhysicsCanvas object.