Box2D Forums

It is currently Sat May 25, 2013 2:55 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Feb 10, 2011 3:31 pm 
Offline

Joined: Mon Apr 07, 2008 3:06 am
Posts: 99
For the character in my platformer game, I have a sensor to his left, and one to his right. When the player presses the CTRL key, I use those sensors to detect if a grabbable object is nearby, and if so, he can push it or drag it around as long as the CTRL-key is held down. In order to grab an object, I construct a revolute joint connecting the object to the player; when the player lets go, the joint is destroyed.

For the most part this is working great. However, I find that once I've grabbed and let go of an object, I'm unable to grab it again -- unless I walk away from it, and then back up to it. Somehow, the ContactEvent for the sensor touching the object gets cleared. I'm guessing it must be caused by the construction of the joint. Is there some way I can manually re-evaluate whether the object and sensor overlap?


Top
 Profile  
 
PostPosted: Thu Feb 10, 2011 9:12 pm 
Offline

Joined: Mon Apr 07, 2008 3:06 am
Posts: 99
Ahhh, solved it myself. I just needed to turn on more reporting options. I've turned on *both* pre-solve and post-solve (should I use just one or the other?) and it's working properly now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group