Skip to content

tes3playerAnimationController⚓︎

Works in conjuction with mobile AI to perform idle, movement, and attack animations. Holds data on the status of the current and next desired animation states for the different body sections that can be animated.

This type inherits the following: tes3actorAnimationController

Properties⚓︎

allowVerticalAirControl⚓︎

Controls if additional vertical movement is possible while jumping or falling, by looking up and down and moving forward in the air. It is unphysical and not used by any normal gameplay mechanic. It is independent of flying movement.

Returns:

  • result (boolean)

alphaProperty⚓︎

The alpha property applied to the actor. Controls the opacity/opaqueness of the actor.

Returns:


animationData⚓︎

Access to the actor's animation data.

Returns:


animGroupIdle⚓︎

The actor's idle animation. Maps to values in tes3.animationGroup table.

Returns:


animGroupIdle2⚓︎

Returns:

  • result (integer)

animGroupMovement⚓︎

The actor's movement animations group. Maps to values in tes3.animationGroup table.

Returns:


attachTiming⚓︎

Returns:

  • result (number)

attackFollowTiming⚓︎

Returns:

  • result (number)

cameraOffset⚓︎

Additional offset applied to the camera's position in the third person view. It may be overridden by MGE.

Returns:


firstPersonHeadCameraNode⚓︎

Read-only. This is the camera used while in first person. Switching from first person to third person point of view doesn't affect this camera.

Returns:


groundPlaneRotation⚓︎

The rotation of the actor around the up-down axis. When converted to euler angles, this axis corresponds to the z axis. The rotation range is [-PI, PI], where rotation of 0 corresponds to the game north.

Returns:


hitTiming⚓︎

This it the time of the actor's attack animation in their .kf, played during the hit phase for fully charged attack. It's updated for the attacks from different directions.

Returns:

  • result (number)

is3rdPerson⚓︎

Read-only. This flag is set to true when the player's view is in third person. To change the player's POV, you can use tes3.force1stPerson and tes3.force3rdPerson.

Returns:

  • result (boolean)

materialProperty⚓︎

The material property applied to the actor.

Returns:


maxAttackTiming⚓︎

This it the time of the actor's attack animation in their .kf file, when the attack animation is fully charged. It's updated for the attacks from different directions.

Returns:

  • result (number)

minAttackTiming⚓︎

This it the time of the actor's attack animation in their .kf file, at the earliest point the attack animation can end (when the attack button is just clicked and released). It's updated for the attacks from different directions.

Returns:

  • result (number)

minHitTiming⚓︎

This it the time of the actor's attack animation in their .kf, played during the hit phase for the minimally charged attack. It's updated for the attacks from different directions.

Returns:

  • result (number)

mobile⚓︎

Read-only. The mobile actor that this controller is responsible for.

Returns:


patchedOverrideState⚓︎

Returns:

  • result (integer)

pickData⚓︎

Read-only.

Returns:


remainingBlockTime⚓︎

Returns:

  • result (number)

shadowCameraMatrix⚓︎

Read-only. The local rotation matrix of the shadow camera.

Returns:


shouldJump⚓︎

Returns:

  • result (integer)

speedMultiplier⚓︎

This is the speed multiplier of the current animation. For example, it is used by the game engine to scale the speed of the turning animation whith the speed at which the player is rotating the view with the mouse. In that case the value range is [0.0, 1.5].

Returns:

  • result (number)

startTime⚓︎

This it the starting time of the actor's attack animation in their .kf file. It's updated for the attacks from different directions.

Returns:

  • result (number)

strikeWhenAttackSwingReaches⚓︎

For NPCs this corresponds to how long the weapon was charged by the NPC after the attack landed. The value is in range [0.0, 1.0]. This property isn't used for the player character.

Returns:

  • result (number)

switchPOVMode⚓︎

This property is briefly set to 1 (doesn't switch when incapacitated) or 2 (always switch) for one frame to change the point of view. You should prefer to use tes3.force1stPerson and tes3.force3rdPerson.

Returns:

  • result (integer)

useThirdPersonAfterVanityCameraDone⚓︎

This flag is set to true if vanity mode was entered from third person view. If vanity mode was entered from first person view, this flag is set to false.

Returns:

  • result (boolean)

vanityCamera⚓︎

Read-only. The vanity camera scene node.

Returns:


vanityCameraAngle⚓︎

The current heading of the orbiting vanity camera, in radians. An angle of 0 places the camera to the north of the player.

Returns:

  • result (number)

vanityCameraDistance⚓︎

The orbiting radius of the camera during vanity mode in game units. Measured from the center of the player's head.

Returns:

  • result (integer)

vanityCameraEnabled⚓︎

The value of this property is 1 during vanity camera mode, and 0 otherwise.

Returns:

  • result (integer)

vanityCameraZ⚓︎

The offset on up-down (world z) axis of the camera in third person or during vanity mode from the player's head height in game units.

Returns:

  • result (number)

vertexColorProperty⚓︎

The vertex color property applied to the actor.

Returns:


verticalRotation⚓︎

Only used for the player. When converted to euler angles, the rotation about x axis will correspond to the rotation obtained from looking up and down. The rotations around other axes are always zero. In degrees the rotations range from -89.95 degrees for looking up, and 89.95 for looking maximally down.

Returns:


weaponSpeed⚓︎

The animation speed scaling of the weapon animations. This includes all weapon related idle, attack, and ready/unready animations. This value is reset at the starting frame of each weapon strike, normally equal to the the weapon speed. Therefore if you use this it should be changed after every strike, and reset after. Ready/unready actions do not change speed, but are affected by speed.

Use by getting the animation controller from the mobile. e.g. mobile.animationController.weaponSpeed = 0.5

Returns:

  • result (number)

Methods⚓︎

calculateAttackSwing⚓︎

Calculates how much an attack is currently being charged. Returns a value ranging from 0.0 to 1.0. A value of 1.0 indicates that the attack is fully charged. Will always return 0.0 when not currently charging an attack.

local result = myObject:calculateAttackSwing()

Returns:

  • result (number)