setPedAnimation | Multi Theft Auto: Wiki Skip to content

setPedAnimation

Client-side
Server-side
Shared

Pair: getPedAnimation

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


Sets the current animation of a player or ped. Not specifying the type of animation will automatically cancel the current one.

Caution

It is possible that an animation will be cancelled if you use setElementFrozen on the ped, but this does not happen all the time.

Syntax

setPedAnimation ( )

Code Examples

server

This example creates a ped, rotates him, and makes him walk:

function makePed()
local thePed = createPed(56, 1, 1, 4, 315)
setPedAnimation(thePed, "ped", "WOMAN_walknorm")
end
addCommandHandler("makemyped", makePed)

Issues

ID Description
1110 retainPedState in setPedAnimation() does not work when latency reduction is set to 1
953 setPedAnimation() "interrupt" and "time" has no effect in certain situations
467 Ped animations don't sync for new players
463 setPedAnimation() does not work when a ped is attached and floating in air
1173 setPedAnimation() removes player jetpack
884 setPedAnimation() messes up collisions of peds inside vehicles

See Also