Remove Weld joint issue

Hi i am using a weld joint to simulated that the player is attached on walls but when i remove this joint to use shoot() function… this things happen… 1.-if i remove on event.phase “began” the player go to the floor because is body is dynamic and i use gravity… 2 if i remove the joint on event.phase “moved” the player takes like 10 miliseconds to go tho the floor… 3.- on event.phase “ended” the player is always attached… HELP!!!

[lua]-------shoot is active
shootActive = false;
glueJointActive = false;

function shoot(event)

if (event.phase == “began”) then
transition.dissolve(flea, player, 1000, 200);
display.getCurrentStage():setFocus(player)
arrow.isVisible = true
arrow.x = player.x;
arrow.y = player.y;

Orb.isVisible = true;
Orb.alpha = 0.75
Orb.x = player.x; Orb.y = player.y
Orb.xScale = 0.5; Orb.yScale = 0.5


elseif (event.phase==“moved” )then
local t = timer.performWithDelay( 10, function()

local distancia=math.ceil( math.sqrt( ((event.yStart - event.y) *(event.yStart - event.y) ) + ((event.xStart - event.x) *(event.xStart - event.x) ) ))
Orb.xScale = -distancia * 0.02
Orb.yScale = -distancia * 0.02

local topolar =(math.ceil(math.atan2( (event.yStart - event.y), (event.xStart - event.x) ) * 180 / math.pi) + 90)
arrow.rotation=topolar
end
)
if(glueJointActive == true) then
glueJoint:removeSelf();
end

elseif (event.phase == “ended”)then
–physics.addBody(player,“dynamic”,{radius = 20,density = 3.0,friction=3})
–physics.start();

player:applyLinearImpulse(event.xStart - event.x, event.yStart - event.y)
display.getCurrentStage():setFocus(nil)
arrow.isVisible = false;
Orb.isVisible = false ;
shootActive=true;

end
end
player:addEventListener (“touch”, shoot)

–in the collision handler, call the function on a 10 millisecond timer

function glue (event)

if(event.phase==“began”)then
if event.other.isWall then
–[[physics.pause();
]]–
timer.performWithDelay( 10,function()
if shootActive==true then
glueJoint = physics.newJoint( “weld”, player,event.other,player.x,player.y)
glueJointActive=true;
shootActive = false;
end
end
)

player:setLinearVelocity( 0, 0 )

end
end

end
player:addEventListener(“collision”,glue)
[/lua] [import]uid: 138440 topic_id: 29202 reply_id: 329202[/import]