I’m trying to add animation at my different shop like the animation on the Online. I’m currently work on my barber shop and the sitting animation. But when my player arrive on the seat, he takes the hitbox at seat and seat 1 meter upper than the normal position.
Do you know how to freeze only the Z coord ?
Example on video :
My code :
AddEventHandler("barbier:animChain", function(v)
Citizen.CreateThread(function()
Wait(100)
local dict ='misshair_shop@barbers'
local myPed = PlayerPedId()
RequestAnimDict(dict)
while not HasAnimDictLoaded(dict) do
Citizen.Wait(0)
end
local animation = ''
local flags = 0 -- only play the animation on the upper body
if Menu.hidden then
animation = 'player_exitchair'
TaskPlayAnim(myPed, dict, animation, 8.0, -8, -1, flags, 0, -1, -1, -1)
Citizen.Wait(100)
SetEntityCollision(GetPlayerPed(-1),true,true)
FreezeEntityPosition(GetPlayerPed(-1),false)
end
end)
end)
Have you tried setting the player position after the animation has been play 1 meter down?
like as soon as the animation to get out of the chair is started set the new coords of the player -1.0 on the z so maybe it will teleport him back into the chair instantly?
I had already try but it don’t work. It will be automatically move up,for the first animation (during sitting time) I have to disable the collision of my ped and freeze it to keep the right position but it’s not possible with the exit because my ped move :S
How to do to put animations to the characters in fivem I do not know what I have to use or how to do I have many things in the server but I have to put animations could help me? That I have to use or how I put the animations or files I need thanks if you can help me