fivem icon indicating copy to clipboard operation
fivem copied to clipboard

Ragdolls are not synced with the server (even when not a dead player)

Open mcNuggets1 opened this issue 1 year ago • 3 comments

What happened?

Ragdolls become desynced when using SetPedToRagdoll and ResetPedRagdollTimer over a period of lying still or if you move too far away. Notably teleporting ragdolled players makes them twitch a lot and have a wrong position in the end too sometimes.

Shooting a ragdoll also causes it to disappear in some scenarios, but I couldn't reproduce this one, it seems related to the death system of GTA V.

Is there any way to fix this behaviour? It also goes so far that the position of a player is completely different from player to player and the local player of course.

Expected result

Ragdolls that are somewhat networked, atleast the position

Reproduction steps

function CreateRagdollThread() CreateThread(function() -- Ragdolling -- Replace "ESX.PlayerData.ped" with "PlayerPedId()" and it should run fine.

	SetEnableHandcuffs(ESX.PlayerData.ped, true)
	SetEnableBoundAnkles(ESX.PlayerData.ped, true)
	SetPedCanPlayInjuredAnims(ESX.PlayerData.ped, false)

	while true do
		if not IsPedRagdoll(ESX.PlayerData.ped) then
			SetPedToRagdoll(ESX.PlayerData.ped, 1000, 1000, 0, false, false, false)
		else
			ResetPedRagdollTimer(ESX.PlayerData.ped)
		end

		Wait(0)
	end

	SetEnableHandcuffs(ESX.PlayerData.ped, false)
	SetEnableBoundAnkles(ESX.PlayerData.ped, false)
	SetPedCanPlayInjuredAnims(ESX.PlayerData.ped, true)
end)

end

Importancy

Slight inconvenience

Area(s)

FiveM, FXServer, Natives

Specific version(s)

FiveM b2944

Additional information

I tried nearly everything and everything failed and then I went on here.

mcNuggets1 avatar Mar 26 '24 16:03 mcNuggets1

afaik, this isn't a fivem bug, its part of the games functionality.

StuxxyOfficial avatar Mar 26 '24 19:03 StuxxyOfficial

I do know that. It's not documented at all, atleast document the ragdoll behaviour somewhere or atleast implement a hotfix fixing the position of the ragdolled player for you locally.

mcNuggets1 avatar Mar 27 '24 12:03 mcNuggets1

Well this is to report bugs within FiveM, feature requests belong on the forums :)

StuxxyOfficial avatar Mar 27 '24 12:03 StuxxyOfficial