# SetObjectAnimationFrame

## Description

Sets the object bone positions to match a given time in the animation. Only objects loaded with LoadObjectWithChildren will have animations assigned to them. Animation names are defined by the modelling program when the animations were created, you can discover what the names are by using GetObjectAnimationName. If the given time falls between keyframes then the bone positions will be interpolated between them. The tweentime parameter can be used to interpolate between the current bone positions and the given time of the animation so that there is no sudden jump in bone positions. Note that as soon as this command is called the bones will be controlled by animation and cannot be moved with SetObjectBonePosition or similar commands. You can regain manual control of individual bones by using SetObjectBoneCanAnimate on it. You can regain control of the entire bone structure by using ResetObjectAnimation.

## Definition

SetObjectAnimationFrame(UINT objID, animName, time, tweentime )

void agk::SetObjectAnimationFrame(UINT objID, const char *animName, float time, float tweentime )

## Parameters

- objID - The ID of the object to modify.
- animName - The name of the animation to play, defined by the modelling program
- time - The point in the animation to read the bone positions, in seconds
- tweentime - The time in seconds to transition from the objects current state to the given frame