I have some physics objects in a display group and I want to move the whole display group using group.x and group.y. Doing this the objects appear to move just fine and when I do physics.setDrawMode(“hybrid”) I can see the boxes around the new location. However the physics of the objects are still in the location they were created and not where I moved them to. Can you not move a group and keep the physics inside the group?
Physics objects can be moved but not the group they are in
Damn. Okay thanks I will have to do some reworking.
Physics objects are rooted in the physics engine so while their display object will move, the physical representation will be based on the 0,0 location of the world. Moving a display group does not shift that portion of the Box 2D world. What you should do is place all objects to be used as physics objects into the same display group OR make sure that you keep the parent display groups of physics objects at the same location relative to each other.
Physics objects can be moved but not the group they are in
Damn. Okay thanks I will have to do some reworking.
Physics objects are rooted in the physics engine so while their display object will move, the physical representation will be based on the 0,0 location of the world. Moving a display group does not shift that portion of the Box 2D world. What you should do is place all objects to be used as physics objects into the same display group OR make sure that you keep the parent display groups of physics objects at the same location relative to each other.
Hi Horacebury …
I think your answer could be reply to my post here http://forums.coronalabs.com/topic/38709-drag-and-drop-haywire-after-moving-displaygroup/#entry201057
Could you maybe assist to find out what I should do to fix my issue?
Thanx in advance!
Hi Horacebury …
I think your answer could be reply to my post here http://forums.coronalabs.com/topic/38709-drag-and-drop-haywire-after-moving-displaygroup/#entry201057
Could you maybe assist to find out what I should do to fix my issue?
Thanx in advance!