What would be the best way to create a wall/ rectangle which rotates but never moves? Other objects should be pushed around by it (it’s a big wheel, constructed out of two long rectangles) but it shouldn’t be pushed around by others.
“kinematic objects are affected by forces but not by gravity, so you should generally set draggable objects to “kinematic”, at least for the duration of the drag event.” [import]uid: 6645 topic_id: 4841 reply_id: 15598[/import]
I have a seesaw in my game. I create a small circle object (just because) and make it a static physics object. I then create a larger dynamic rectangle object over the top of it. What makes it a rotating rectangle which can either be moved by other objects or kick them object (when under its own force) is the pivot joint placed at the centre of the circle object. The following code is off the top of my head as I’m at work (without mac) but should give a good indication…
[lua]local circle = display.newCircle( 100,100, 5 )
local rect = display.newRect( 0,0 , 100,10 )
rect.x, rect.y = circle.x, circle.y – also colour the rect here