A few hours of research and digging through decompiled scripts, I’m at a bit of a loss.
I’m trying to play synchronized animations between multiple players, though the target player is never able to see animation on their client as the executor of the script is never able to effectively add them into the scene as they do not have network control of the players ped, which is a given although in the decompiled scripts, for example, entering the MP apartment, R* gains network control over the players ped and the animation is all smooth.
function SyncronizedAnimation(targetPlayer)
local playerPed = GetPlayerPed(-1)
local targetPed = GetPlayerPed(targetPlayer)
local thisDict = 'mp_ped_interaction'
local playerAnim = 'handshake_guy_a'
local targetAnim = 'handshake_guy_b'
Citizen.CreateThread(function()
local networkScene = NetworkCreateSynchronisedScene(GetEntityCoords(targetPed), GetEntityRotation(targetPed), 2, true, false, 1.0, 0, 1.0)
NetworkAddPedToSynchronisedScene(playerPed, networkScene, thisDict, targetAnim, 1.5, -8.0, 7, 0, 1.5, 0)
NetworkAddPedToSynchronisedScene(targetPed, networkScene, thisDict, playerAnim, 1000.0, -8.0, 7, 0, 1.5, 0)
NetworkStartSynchronisedScene(networkScene)
Wait(1)
local testScene = NetworkUnlinkNetworkedSynchronisedScene(networkScene)
while GetSynchronizedScenePhase(testScene) < .60 do
Wait(1)
end
NetworkStopSynchronisedScene(networkScene)
end)
end
This is currently what I have, I had thought to clone the ped, create a temporary camera for the target player and then set the ped back but ChangePlayerPed
is pretty broken.
Any help would be appreciated