PlayIdle - Actor

Revision as of 16:22, 25 July 2023 by BellCube (talk | contribs) (Remove superfluous "form to whose animation", leaving "The idle to play on this actor")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Member of: Actor Script

Plays the idle passed.

SyntaxEdit

bool Function PlayIdle(Idle akIdle) native

ParametersEdit

  • akIdle: The idle to play on this actor.

Return ValueEdit

True if the idle was successfully loaded and played, false otherwise.

ExamplesEdit

; Start Hadvar's flute animation
 if Hadvar.PlayIdle(fluteIdle)
   Debug.Trace("Hadvar is playing his flute!")
 else
   Debug.Trace("Something went wrong")
 endIf


;Force Prisoner idle. Below is how to properly setup an actor in the "bound hands" pose as seen in first scene of the game in helgen.
Idle property OffsetBoundStandingStart auto

;Place this inside an Event, Function, etc
myActor.PlayIdle(OffsetBoundStandingStart)

NotesEdit

  • Too many things can happen while you are attempting to play an idle, so make sure to gracefully handle all circumstances. Never use the structure "play idle, wait for event" - this will inevitably cause your script to get stuck forever when some other code or script overrules your idle. Calling the PlayIdle function on the same actor, with the same idle again, will have the actor stop playing it (if it's a looped animation).
  • Some idles cannot be played with this function if the idle has an associated special furniture and is not listed in the idle manager. To which other means to force a player to play such an idle is required.
  • You cannot play an idle on an actor whose AI is disabled.

See AlsoEdit