Moving group problem

I need to move about 20 objects, so I made new group for them and move the group as I need…
This group is inserted in my main group…
But there are 2 object with images which moved correctly, but the others objects which are rects created with:

rect1 = display.newRect(200,100,40, 40);

Are still in the same positions…
I need to move this group only for 5px to right, but “rects” stay in the same place as before… why?

Thanks! [import]uid: 59968 topic_id: 20765 reply_id: 320765[/import]

Are the rect’s inserted into the group also? [import]uid: 84637 topic_id: 20765 reply_id: 81664[/import]

Yes, they are…it’s weird… [import]uid: 59968 topic_id: 20765 reply_id: 81666[/import]

Could you post up some code, that should work [import]uid: 84637 topic_id: 20765 reply_id: 81668[/import]

local localGroup = display.newGroup();  
localGroup.x = 0;  
localGroup.y = 0;  
  
local rectGroup = display.newGroup();  
rectGroup.x = 5;  
  
-- There are some objects in localgroup  
  
 platform = display.newImageRect("images/platform.png", 390, 61);  
 platform.x = 234; platform.y = 260;  
  
 --slot01  
 rect01 = display.newRect(200,100,40, 40);  
 rect01.x = 82; rect01.y = 87;  
  
 --slot02  
 rect02 = display.newRect(200,100,40, 40);  
 rect02.x = 135; rect02.y = 87;  
  
--[[  
  
More rects created the same way here...  
  
--]]  
  
localGroup:insert(rectGroup);  
rectGroup:insert(rect01);  
rectGroup:insert(rect02);  
rectGroup:insert(platform);  
  

Platform moves correctly with position of “rectGroup”, but rects stay still on the same place… [import]uid: 59968 topic_id: 20765 reply_id: 81671[/import]

You need to set the groups position after inserting the objects, not before. [import]uid: 84637 topic_id: 20765 reply_id: 81674[/import]

I tried… not helped :frowning: [import]uid: 59968 topic_id: 20765 reply_id: 81675[/import]

Are you moving the group anywhere aside from that code you posted up? [import]uid: 84637 topic_id: 20765 reply_id: 81677[/import]