|
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?
|