JoyStick attached to an object and move with it

i have an object ( player ) and i want to create 4 other objects ( triangles left,right,up,down )  and attach those triangles to my player so i can use t hose to move that player by touching them . but i want those triangles to move with the player …

i move the player using setLinearVelocity , i accomplish to attach them using distacnce joint and it works as i want . but the problem is when the player stop moving ( example hit a static object ) the triangles kept going in the same direction

playerHappy=display.newImageRect( "images/player1.png", CELL\_WIDTH-2, CELL\_HEIGHT-2 ) playerHappy.x=grid[24].x playerHappy.y=grid[24].y physics.addBody( playerHappy, "dynamic", { outline=PlayerHappyimageOutline, friction=100.0, density=100.0 , bounce=0.0 } ) playerHappy.isFixedRotation = true sceneGroup:insert(playerHappy) local ArrowRight = display.newImageRect("images/ArrowRight.png", CELL\_WIDTH-2, CELL\_HEIGHT-2) ArrowRight.x=playerHappy.x+playerHappy.width ArrowRight.y=playerHappy.y physics.addBody( ArrowRight, "kinematic", { outline=PlayerHappyimageOutline, friction=100.0, density=100.0 , bounce=0.0 } ) local distanceJoint = physics.newJoint( "distance", playerHappy, ArrowRight, playerHappy.x, playerHappy.y, ArrowRight.x, ArrowRight.y )

any help :slight_smile:

Have you looked at distanceJoint.dampingRation and distanceJoint.frequency?

i will check and get back to you thanks

nope non of this works .

i just need my 4 tri to move with the object

Have you considered adding them all to a group and moving the group?

Rob

any help :slight_smile:

Have you looked at distanceJoint.dampingRation and distanceJoint.frequency?

i will check and get back to you thanks

nope non of this works .

i just need my 4 tri to move with the object

Have you considered adding them all to a group and moving the group?

Rob