I tried to implement the Weld Joint in my app and It works great, though I do still have some problem with rotation.
I added physics on my blades:
local blade2 = display.newImageRect(group, "IMG/blade.png", 70, 70); physics.addBody(blade2, "dynamic"); blade2.gravityScale = 0; blade2.x = pipeBottomPiece.x; blade2.y = pipeBottomPiece.contentBounds.yMin;
and I joint them successfully with the pipes:
local weldJoint2 = physics.newJoint( "weld", pipeBottomPiece, blade2, pipeBottomPiece.x, pipeBottomPiece.contentBounds.yMin )
Now for the continuous rotation I couldn’t keep rotation.object as It doesn’t seem to work for physical objects, so I tried transitions:
local onComplete2 = function( self ) self.rotation = 0 blade2Transition = transition.to( self, { rotation=360, time=500, onComplete = self }) end blade2.onComplete = onComplete2 blade2Transition = transition.to( blade2, { rotation=360, time=500, onComplete = blade2 })
This works really well in the Corona Simulator, but when I try it in the Xcode Simulator with iOS 9.3 It speeds up the rotation and It looks a bit buggy, but still works.
I was wondering what happens with rotation in iOS 9.3 and I found this forum post: https://forums.coronalabs.com/topic/2252-how-to-make-object-follow-another-object/
Could the game timer be the problem with my app in iOS 9?
thanks