Good morning/afternoon/evening,
I have stumbled across a quite annoying problem with animations and, sadly, reviewing many animation-related topics did not lead me to solving the problem.
Goal is simple: force a "talking" animation upon player when he says something in the chat and make him able to move during the animation.
The issue is that the player, who was previously affected by an animation, keeps running with his arms down below. The issue seems to stick unless a player/ped performs any kind of action - punching, jumping, shooting e.t.c. [video linked below in a spoiler]
Topics that covered some kind of animation freezing issues were usually solved by a) using setTimer() and nullifying the animation with setPedAnimation(ped) function combination or b) making an animation stalemate [by setting freezeLastFrame to false]; however, both of those methods are dissatisfying.
If someone has stumbled across anything similar, any kind of advice will be of much help! Thanks in advance!
Code that displays the issue:
addEventHandler ( "onPlayerChat", root, function ( message, mType )
if ( mType == 0 ) then
--[[ .. some code .. ]]--
if not isPedInVehicle(source) then
setPedAnimation (source, "ped", "IDLE_CHAT", 0, false, true, true, true)
end
elseif ( mType == 1 ) then
--[[ .. some code .. ]]--
end
end
)
Video example: