Ox_target and dragging a player

Hello,
so basically I have a handcuff resource on my server that was handled by a menu. I recently changed the handle method to ox_target and can’t really get the resource to working. In the handcuff resource i have various tasks, like putting a player in the vehicle, restraining and dragging a player. The method I am using to drag a player is
AttachEntityToEntity(playerPed, targetPed, 11816, 0.54, 0.54, 0.0, 0.0, 0.0, 0.0, false, true, false, true, 2, true)
After adding it to ox_target (as an option):

{
name = ‘drag’,
icon = ‘fa-thin fa-person-walking’,
label = ‘moven’,
distance = 0,
onSelect = function(data)
local closestPlayer = ESX.Game.GetClosestPlayer()
TriggerServerEvent(‘esx_cuff:drag’, GetPlayerServerId(closestPlayer))
end,
canInteract = function(entity)
return IsPedInAnyVehicle(PlayerPedId(-1))
end
},

I can start dragging a player, the eye appears, but when I try to stop the eye won’t target the player. Is there any solution to this?

any ideas?

It’s because you don’t have collision with dragged Entity. The way that targets works is that they raycast and search for entities, if entity doesn’t have any collision, it just wont register any raycast hit and entity won’t be found. You just need to change collision option in attachEntityToEntity and it should work