This project has moved and is read-only. For the latest updates, please go here.

moving texture along with rigidbody

Oct 8, 2011 at 11:49 AM

Hi I am making a basket in which whatever gets dropped from the top gets collected in the basket.

For this I have made a basket which is a texture 2d. Then I plan to create a 2 pixel thick physics body around the sides and the base of the basket.


As of now  I have made the texture 2d basket and able to move the basket. I have also to created a rigid body. But I am not able to make it move along with the basket. 

So I tried the other way round. I am able to move the rigidbody by applying impulse and assign rigidbody position to texture posiotion. But the texture moves slowly as compared to the rigidbody !!


I would like to move the texture 2d so that I move the physics body also moves along with it. I am so confused and to why it is not happening. Pls help. Thanks.

Oct 8, 2011 at 1:05 PM

okay, finally got the sprite move along with the movement of the physics body. But there is a delay between the movement of sprite and body. looks like the body moves faster than sprite. how do  fix this?

Also, as the body moves faster, I think it is better if I move the sprite so that the body along with it and not the other way round. But  I am not able to move the body to the basket.?? Hmmm....

Oct 9, 2011 at 11:04 AM

i think the delay is caused because you get the bodys position and after that you update your world so you allways get the position of the last frame

change the order and it should be fixed