GravityContoller vs Chain problem

Topics: Developer Forum, User Forum
Nov 6, 2009 at 1:31 AM

Hello! I am making a 2D space game, and in the game, I have a chain (Farseer Path) anchored to my ship and the other end of it swinging around to catch on to other things. Everything was working perfectly! Thats until i added the GravityController for planetary gravity. Even when my ship isn't in the range of a gravity point in the gravity controller, it starts jerking like crazy. When I remove the chain, everything is just fine.

Like I said, I have the first body in the chain anchored, with a slider joint, to the center of my space ship. What is the problem?


Nov 6, 2009 at 1:42 AM

Also for some more information, I just did a test. When I stopped updating (calling Update) on the gravity controller, the jumping stopped. So it has something to do with the gravity controller. Any thoughts on how to fix this?

Nov 9, 2009 at 3:54 AM

Hi, i'm actually one of the people that made the GravityController initially, and i think i can help.

I bet you called the ComplexFactory.CreateGravityController function overload with the FarseerPhysicsSim (or whatever it's called, haven't had the opportunity to use it lately) argument didn't you? In any case, the physics simulator handles updating of everything so you're not supposed to directly call update on it, the engine will handle it.