It looks like you're new here. If you want to get involved, click one of these buttons!
 rrraptor            
            
                Member
rrraptor            
            
                Member             
            
| function Box:setX2(x) self:setX(x) self._body_pos[1] = x self.body:setPosition(x, self._body_pos[2]) end function Box:setY2(y) self:setY(y) self._body_pos[2] = y self.body:setPosition(self._body_pos[1], y) end function Box:setPosition2(x,y) self:setPosition(x, y) self._body_pos[1] = x self._body_pos[2] = y self.body:setPosition(x, y) end | 
Comments
In short, you can use setPosition method outside of the world:step method. This means, do not use it in box2d callbacks(PRESOLVE,POSTSOLVE,BEGIN_CONTACT etc).
Well, i think i can do it by using only dynamic bodies, but with 0 gravity. And for non dragable objects apply impulse/set angular velocity. Idk, need to try.
Anyway, i solved my problem
I'm just setting the linear velocity like:
Project attached.
Likes: antix